home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Environments / AAISProlog / Examples / Apple Events / Talk with Prolog.p < prev    next >
MacBinary  |  1992-06-10  |  18.9 KB  |  [TEXT/AIFC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert bsdiff patch (other/bsdiffPatch) ext Unsupported
1% dexvert imgdiff patch (other/imgdiffPatch) ext Unsupported
1% dexvert WSUS Patch Storage File (other/wsusPatchStorageFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Jun 10 10:46:23 1992, modified Wed Jun 10 10:46:23 1992, creator 'AIFC', type ASCII, 18467 bytes "Talk with Prolog.p" , at 0x48a3 532 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[AIFC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 54 61 6c 6b 20 77 | 69 74 68 20 50 72 6f 6c |..Talk w|ith Prol|
|00000010| 6f 67 2e 70 00 00 00 00 | 00 00 00 00 00 00 00 00 |og.p....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 41 49 46 | 43 01 00 00 00 00 00 00 |.TEXTAIF|C.......|
|00000050| 00 00 00 00 00 48 23 00 | 00 02 14 a6 5b c6 3f a6 |.....H#.|....[.?.|
|00000060| 5b c6 3f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |[.?.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 42 b4 00 00 |........|....B...|
|00000080| 2f 2a 0d 20 2a 20 54 61 | 6c 6b 20 77 69 74 68 20 |/*. * Ta|lk with |
|00000090| 50 72 6f 6c 6f 67 2e 70 | 3a 20 54 61 6c 6b 69 6e |Prolog.p|: Talkin|
|000000a0| 67 20 77 69 74 68 20 50 | 72 6f 6c 6f 67 20 41 70 |g with P|rolog Ap|
|000000b0| 70 6c 65 20 45 76 65 6e | 74 20 45 78 61 6d 70 6c |ple Even|t Exampl|
|000000c0| 65 2e 0d 20 2a 0d 20 2a | 20 43 6f 70 79 72 69 67 |e.. *. *| Copyrig|
|000000d0| 68 74 2c 20 a9 20 31 39 | 39 32 20 41 64 76 61 6e |ht, . 19|92 Advan|
|000000e0| 63 65 64 20 41 2e 20 49 | 2e 20 53 79 73 74 65 6d |ced A. I|. System|
|000000f0| 73 2c 20 49 6e 63 2e 0d | 20 2a 20 41 6c 6c 20 72 |s, Inc..| * All r|
|00000100| 69 67 68 74 73 20 72 65 | 73 65 72 76 65 64 2e 0d |ights re|served..|
|00000110| 20 2a 20 54 68 69 73 20 | 66 69 6c 65 20 6d 61 79 | * This |file may|
|00000120| 20 6e 6f 74 20 62 65 20 | 63 6f 70 69 65 64 20 6f | not be |copied o|
|00000130| 72 20 64 69 73 74 72 69 | 62 75 74 65 64 20 77 69 |r distri|buted wi|
|00000140| 74 68 6f 75 74 20 74 68 | 65 20 0d 20 2a 20 77 72 |thout th|e . * wr|
|00000150| 69 74 74 65 6e 20 70 65 | 72 6d 69 73 73 69 6f 6e |itten pe|rmission|
|00000160| 20 6f 66 20 41 64 76 61 | 6e 63 65 64 20 41 2e 20 | of Adva|nced A. |
|00000170| 49 2e 20 53 79 73 74 65 | 6d 73 2c 20 49 6e 63 2e |I. Syste|ms, Inc.|
|00000180| 0d 20 2a 0d 20 2a 20 54 | 68 69 73 20 66 69 6c 65 |. *. * T|his file|
|00000190| 20 64 65 66 69 6e 65 73 | 20 61 20 73 65 74 20 6f | defines| a set o|
|000001a0| 66 20 73 69 6d 70 6c 65 | 20 66 75 6e 63 74 69 6f |f simple| functio|
|000001b0| 6e 73 20 66 6f 72 20 74 | 61 6c 6b 69 6e 67 20 77 |ns for t|alking w|
|000001c0| 69 74 68 20 0d 20 2a 20 | 50 72 6f 6c 6f 67 20 69 |ith . * |Prolog i|
|000001d0| 74 73 65 6c 66 2e 20 20 | 54 68 69 73 20 73 65 6e |tself. |This sen|
|000001e0| 64 73 20 74 68 65 20 61 | 70 70 6c 65 20 65 76 65 |ds the a|pple eve|
|000001f0| 6e 74 73 20 62 61 63 6b | 20 74 6f 20 74 68 69 73 |nts back| to this|
|00000200| 20 70 72 6f 63 65 73 73 | 2e 0d 20 2a 20 54 6f 20 | process|.. * To |
|00000210| 72 75 6e 20 74 77 6f 20 | 50 72 6f 6c 6f 67 20 6f |run two |Prolog o|
|00000220| 6e 20 61 6e 20 41 70 70 | 6c 65 54 61 6c 6b 20 6e |n an App|leTalk n|
|00000230| 65 74 77 6f 72 6b 2c 20 | 79 6f 75 20 6e 65 65 64 |etwork, |you need|
|00000240| 20 74 77 6f 20 64 69 66 | 66 65 72 65 6e 74 0d 20 | two dif|ferent. |
|00000250| 2a 20 73 65 72 69 61 6c | 20 6e 75 6d 62 65 72 73 |* serial| numbers|
|00000260| 2e 0d 20 2a 20 42 79 20 | 64 65 66 61 75 6c 74 2c |.. * By |default,|
|00000270| 20 74 68 69 73 20 73 65 | 6e 64 73 20 61 70 70 6c | this se|nds appl|
|00000280| 65 20 65 76 65 6e 74 73 | 20 62 61 63 6b 20 74 6f |e events| back to|
|00000290| 20 74 68 69 73 20 73 61 | 6d 65 20 70 72 6f 63 65 | this sa|me proce|
|000002a0| 73 73 2e 0d 20 2a 0d 20 | 2a 20 54 68 65 20 69 63 |ss.. *. |* The ic|
|000002b0| 6f 6e 20 75 73 65 64 20 | 69 73 20 73 74 6f 72 65 |on used |is store|
|000002c0| 64 20 69 6e 20 74 68 69 | 73 20 66 69 6c 65 73 27 |d in thi|s files'|
|000002d0| 20 72 65 73 6f 75 72 63 | 65 20 66 6f 72 6b 20 61 | resourc|e fork a|
|000002e0| 6e 64 20 77 61 73 20 63 | 72 65 61 74 65 64 0d 20 |nd was c|reated. |
|000002f0| 2a 20 77 69 74 68 20 52 | 65 73 45 64 69 74 2e 0d |* with R|esEdit..|
|00000300| 20 2a 0d 20 2a 20 44 65 | 66 69 6e 65 64 20 69 6e | *. * De|fined in|
|00000310| 20 74 68 69 73 20 66 69 | 6c 65 3a 0d 20 2a 0d 70 | this fi|le:. *.p|
|00000320| 72 6f 6c 6f 67 5f 61 65 | 5f 64 65 6d 6f 0d 09 53 |rolog_ae|_demo..S|
|00000330| 65 74 75 70 20 61 6e 20 | 69 6e 74 65 72 61 63 74 |etup an |interact|
|00000340| 69 76 65 20 64 69 61 6c | 6f 67 20 66 6f 72 20 74 |ive dial|og for t|
|00000350| 65 73 74 69 6e 67 20 61 | 70 70 6c 65 20 65 76 65 |esting a|pple eve|
|00000360| 6e 74 73 20 74 6f 2f 66 | 72 6f 6d 0d 09 41 41 49 |nts to/f|rom..AAI|
|00000370| 53 20 50 72 6f 6c 6f 67 | 20 74 6f 2f 66 72 6f 6d |S Prolog| to/from|
|00000380| 20 41 41 49 53 20 50 72 | 6f 6c 6f 67 2e 20 20 54 | AAIS Pr|olog. T|
|00000390| 68 69 73 20 69 73 20 72 | 75 6e 20 61 75 74 6f 6d |his is r|un autom|
|000003a0| 61 74 69 63 61 6c 6c 79 | 0d 09 77 68 65 6e 20 74 |atically|..when t|
|000003b0| 68 69 73 20 66 69 6c 65 | 20 69 73 20 63 6f 6e 73 |his file| is cons|
|000003c0| 75 6c 74 65 64 2e 0d 09 | 52 75 6e 20 74 68 69 73 |ulted...|Run this|
|000003d0| 20 74 6f 20 0d 61 65 41 | 73 73 65 72 74 0d 09 50 | to .aeA|ssert..P|
|000003e0| 72 6f 6d 70 74 20 66 6f | 72 20 61 20 66 61 63 74 |rompt fo|r a fact|
|000003f0| 2f 72 75 6c 65 20 61 6e | 64 20 74 68 65 6e 20 61 |/rule an|d then a|
|00000400| 73 73 65 72 74 20 69 74 | 20 76 69 61 0d 09 61 70 |ssert it| via..ap|
|00000410| 70 6c 65 20 65 76 65 6e | 74 73 20 69 6e 74 6f 20 |ple even|ts into |
|00000420| 50 72 6f 6c 6f 67 2e 0d | 61 65 41 73 73 65 72 74 |Prolog..|aeAssert|
|00000430| 28 46 61 63 74 29 0d 09 | 41 73 73 65 72 74 20 74 |(Fact)..|Assert t|
|00000440| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 66 61 63 |he speci|fied fac|
|00000450| 74 2f 72 75 6c 65 20 76 | 69 61 20 41 70 70 6c 65 |t/rule v|ia Apple|
|00000460| 20 45 76 65 6e 74 73 2e | 0d 61 65 51 75 65 72 79 | Events.|.aeQuery|
|00000470| 0d 09 50 72 6f 6d 70 74 | 20 66 6f 72 20 61 20 67 |..Prompt| for a g|
|00000480| 6f 61 6c 20 61 6e 64 20 | 74 68 65 6e 20 73 75 62 |oal and |then sub|
|00000490| 6d 69 74 20 69 74 20 76 | 69 61 0d 09 61 70 70 6c |mit it v|ia..appl|
|000004a0| 65 20 65 76 65 6e 74 73 | 20 69 6e 74 6f 20 50 72 |e events| into Pr|
|000004b0| 6f 6c 6f 67 2e 0d 61 65 | 51 75 65 72 79 28 53 74 |olog..ae|Query(St|
|000004c0| 72 69 6e 67 29 0d 09 51 | 75 65 72 79 20 74 68 65 |ring)..Q|uery the|
|000004d0| 20 73 70 65 63 69 66 69 | 65 64 20 67 6f 61 6c 20 | specifi|ed goal |
|000004e0| 28 69 6e 20 61 20 73 74 | 72 69 6e 67 29 20 76 69 |(in a st|ring) vi|
|000004f0| 61 20 41 70 70 6c 65 20 | 45 76 65 6e 74 73 2e 0d |a Apple |Events..|
|00000500| 20 2a 2f 0d 3a 2d 20 61 | 61 69 73 5f 6d 6f 64 65 | */.:- a|ais_mode|
|00000510| 2e 0d 0d 3a 2d 20 67 65 | 74 5f 63 75 72 72 65 6e |...:- ge|t_curren|
|00000520| 74 5f 64 69 72 65 63 74 | 6f 72 79 28 45 78 61 6d |t_direct|ory(Exam|
|00000530| 70 6c 65 73 46 6f 6c 64 | 65 72 29 2c 0d 20 20 20 |plesFold|er),. |
|00000540| 66 75 6c 6c 5f 66 69 6c | 65 5f 6e 61 6d 65 28 45 |full_fil|e_name(E|
|00000550| 78 61 6d 70 6c 65 73 46 | 6f 6c 64 65 72 2c 20 27 |xamplesF|older, '|
|00000560| 54 61 6c 6b 20 57 69 74 | 68 20 50 72 6f 6c 6f 67 |Talk Wit|h Prolog|
|00000570| 2e 70 27 2c 20 54 68 69 | 73 46 69 6c 65 29 2c 0d |.p', Thi|sFile),.|
|00000580| 20 20 20 73 65 74 5f 67 | 6c 6f 62 61 6c 28 74 68 | set_g|lobal(th|
|00000590| 69 73 5f 66 69 6c 65 2c | 20 54 68 69 73 46 69 6c |is_file,| ThisFil|
|000005a0| 65 29 2e 0d 0d 2f 2a 0d | 20 2a 20 41 49 46 43 20 |e).../*.| * AIFC |
|000005b0| 69 73 20 74 68 65 20 63 | 72 65 61 74 6f 72 20 63 |is the c|reator c|
|000005c0| 6f 64 65 20 66 6f 72 20 | 41 41 49 53 20 46 75 6c |ode for |AAIS Ful|
|000005d0| 6c 20 43 6f 6e 74 72 6f | 6c 20 50 72 6f 6c 6f 67 |l Contro|l Prolog|
|000005e0| 2e 0d 20 2a 20 54 68 69 | 73 20 77 69 6c 6c 20 73 |.. * Thi|s will s|
|000005f0| 65 6e 74 20 74 68 69 73 | 20 74 6f 20 74 68 69 73 |ent this| to this|
|00000600| 20 70 72 6f 63 65 73 73 | 21 21 21 21 0d 20 2a 20 | process|!!!!. * |
|00000610| 54 68 65 73 65 20 61 72 | 65 20 74 68 65 20 64 65 |These ar|e the de|
|00000620| 66 61 75 6c 74 20 73 65 | 74 74 69 6e 67 73 3a 0d |fault se|ttings:.|
|00000630| 20 2a 2f 0d 2f 2a 0d 20 | 2a 20 74 68 69 73 5f 70 | */./*. |* this_p|
|00000640| 72 6f 63 65 73 73 28 50 | 72 6f 63 65 73 73 49 6e |rocess(P|rocessIn|
|00000650| 66 6f 52 65 63 29 0d 20 | 2a 09 52 65 74 75 72 6e |foRec). |*.Return|
|00000660| 20 74 68 65 20 70 72 6f | 63 65 73 73 49 6e 66 6f | the pro|cessInfo|
|00000670| 52 65 63 20 61 73 73 6f | 63 69 61 74 65 64 20 77 |Rec asso|ciated w|
|00000680| 69 74 68 20 74 68 69 73 | 20 72 75 6e 6e 69 6e 67 |ith this| running|
|00000690| 0d 20 2a 09 70 72 6f 6c | 6f 67 20 61 70 70 6c 69 |. *.prol|og appli|
|000006a0| 63 61 74 69 6f 6e 2e 0d | 20 2a 20 54 68 69 73 20 |cation..| * This |
|000006b0| 69 73 20 75 73 65 66 75 | 6c 20 74 6f 20 73 65 6e |is usefu|l to sen|
|000006c0| 64 20 61 70 70 6c 65 20 | 65 76 65 6e 74 73 20 74 |d apple |events t|
|000006d0| 6f 20 74 68 69 73 20 73 | 61 6d 65 20 50 72 6f 6c |o this s|ame Prol|
|000006e0| 6f 67 20 70 72 6f 63 65 | 73 73 2c 0d 20 2a 09 75 |og proce|ss,. *.u|
|000006f0| 73 69 6e 67 20 73 65 6e | 64 5f 61 70 70 6c 65 5f |sing sen|d_apple_|
|00000700| 65 76 65 6e 74 2e 0d 20 | 2a 20 44 6f 20 6e 6f 74 |event.. |* Do not|
|00000710| 20 75 73 65 20 63 72 65 | 61 74 6f 72 20 63 6f 64 | use cre|ator cod|
|00000720| 65 73 20 74 6f 20 72 65 | 66 65 72 20 74 6f 20 74 |es to re|fer to t|
|00000730| 68 69 73 20 70 72 6f 63 | 65 73 73 2e 20 28 22 41 |his proc|ess. ("A|
|00000740| 49 46 43 22 29 2e 0d 20 | 2a 20 49 66 20 79 6f 75 |IFC").. |* If you|
|00000750| 20 64 6f 20 73 6f 2c 20 | 61 6c 6c 20 77 61 69 74 | do so, |all wait|
|00000760| 5f 72 65 70 6c 79 20 73 | 65 6e 74 20 62 61 63 6b |_reply s|ent back|
|00000770| 20 74 6f 20 74 68 69 73 | 20 70 72 6f 63 65 73 73 | to this| process|
|00000780| 20 77 69 6c 6c 20 62 65 | 20 0d 20 2a 20 74 72 65 | will be| . * tre|
|00000790| 61 74 65 64 20 61 73 20 | 71 75 65 75 65 5f 72 65 |ated as |queue_re|
|000007a0| 70 6c 79 20 69 6e 73 74 | 65 61 64 2e 0d 20 2a 2f |ply inst|ead.. */|
|000007b0| 0d 74 68 69 73 5f 70 72 | 6f 63 65 73 73 28 50 72 |.this_pr|ocess(Pr|
|000007c0| 6f 63 65 73 73 49 6e 66 | 6f 52 65 63 29 20 3a 2d |ocessInf|oRec) :-|
|000007d0| 0d 09 67 65 74 43 75 72 | 72 65 6e 74 50 72 6f 63 |..getCur|rentProc|
|000007e0| 65 73 73 28 50 72 6f 63 | 65 73 73 53 65 72 69 61 |ess(Proc|essSeria|
|000007f0| 6c 4e 75 6d 62 65 72 2c | 20 30 29 2c 0d 09 70 72 |lNumber,| 0),..pr|
|00000800| 6f 63 65 73 73 28 50 72 | 6f 63 65 73 73 49 6e 66 |ocess(Pr|ocessInf|
|00000810| 6f 52 65 63 2c 20 5f 50 | 72 6f 63 65 73 73 4e 61 |oRec, _P|rocessNa|
|00000820| 6d 65 29 2c 0d 09 2f 2a | 0d 09 20 2a 20 49 66 20 |me),../*|.. * If |
|00000830| 77 65 20 63 6f 6d 70 61 | 72 65 20 74 68 65 20 72 |we compa|re the r|
|00000840| 65 63 6f 72 64 2c 20 74 | 68 65 20 61 64 64 72 65 |ecord, t|he addre|
|00000850| 73 73 20 6f 66 20 74 68 | 65 20 72 65 63 6f 72 64 |ss of th|e record|
|00000860| 73 0d 09 20 2a 09 77 69 | 6c 6c 20 62 65 20 63 6f |s.. *.wi|ll be co|
|00000870| 6d 70 61 72 65 64 2c 20 | 6e 6f 74 20 74 68 65 20 |mpared, |not the |
|00000880| 64 61 74 61 20 69 6e 20 | 74 68 65 20 72 65 63 6f |data in |the reco|
|00000890| 72 64 73 2e 0d 09 20 2a | 20 57 65 20 6e 65 65 64 |rds... *| We need|
|000008a0| 20 74 6f 20 63 6f 6d 70 | 61 72 65 20 74 68 65 20 | to comp|are the |
|000008b0| 64 61 74 61 20 6f 6e 6c | 79 2e 0d 09 20 2a 2f 0d |data onl|y... */.|
|000008c0| 09 50 72 6f 63 65 73 73 | 49 6e 66 6f 52 65 63 5e |.Process|InfoRec^|
|000008d0| 2e 70 72 6f 63 65 73 73 | 4e 75 6d 62 65 72 5e 2e |.process|Number^.|
|000008e0| 68 69 67 68 4c 6f 6e 67 | 4f 66 50 53 4e 20 3d 3a |highLong|OfPSN =:|
|000008f0| 3d 20 0d 09 09 50 72 6f | 63 65 73 73 53 65 72 69 |= ...Pro|cessSeri|
|00000900| 61 6c 4e 75 6d 62 65 72 | 5e 2e 68 69 67 68 4c 6f |alNumber|^.highLo|
|00000910| 6e 67 4f 66 50 53 4e 2c | 0d 09 50 72 6f 63 65 73 |ngOfPSN,|..Proces|
|00000920| 73 49 6e 66 6f 52 65 63 | 5e 2e 70 72 6f 63 65 73 |sInfoRec|^.proces|
|00000930| 73 4e 75 6d 62 65 72 5e | 2e 6c 6f 77 4c 6f 6e 67 |sNumber^|.lowLong|
|00000940| 4f 66 50 53 4e 20 3d 3a | 3d 20 0d 09 09 50 72 6f |OfPSN =:|= ...Pro|
|00000950| 63 65 73 73 53 65 72 69 | 61 6c 4e 75 6d 62 65 72 |cessSeri|alNumber|
|00000960| 5e 2e 6c 6f 77 4c 6f 6e | 67 4f 66 50 53 4e 2c 0d |^.lowLon|gOfPSN,.|
|00000970| 09 21 2e 0d 3a 2d 20 74 | 68 69 73 5f 70 72 6f 63 |.!..:- t|his_proc|
|00000980| 65 73 73 28 41 49 46 43 | 29 2c 20 73 65 74 5f 67 |ess(AIFC|), set_g|
|00000990| 6c 6f 62 61 6c 28 70 72 | 6f 6c 6f 67 5f 74 61 6c |lobal(pr|olog_tal|
|000009a0| 6b 69 6e 67 5f 77 69 74 | 68 2c 20 41 49 46 43 29 |king_wit|h, AIFC)|
|000009b0| 2e 0d 3a 2d 20 73 65 74 | 5f 67 6c 6f 62 61 6c 28 |..:- set|_global(|
|000009c0| 72 65 70 6c 79 5f 6d 6f | 64 65 2c 20 71 75 65 75 |reply_mo|de, queu|
|000009d0| 65 5f 72 65 70 6c 79 29 | 2e 0d 0d 2f 2a 0d 20 2a |e_reply)|.../*. *|
|000009e0| 20 46 69 72 73 74 20 77 | 65 20 64 65 66 69 6e 65 | First w|e define|
|000009f0| 20 61 6e 20 61 70 70 6c | 65 20 65 76 65 6e 74 20 | an appl|e event |
|00000a00| 74 68 61 74 20 72 65 63 | 65 69 76 65 73 20 61 20 |that rec|eives a |
|00000a10| 67 6f 61 6c 20 74 6f 20 | 62 65 20 61 73 73 65 72 |goal to |be asser|
|00000a20| 74 65 64 2e 0d 20 2a 20 | 53 65 65 20 56 6f 6c 75 |ted.. * |See Volu|
|00000a30| 6d 65 20 32 2c 20 50 61 | 67 65 20 33 35 37 20 6f |me 2, Pa|ge 357 o|
|00000a40| 66 20 74 68 65 20 41 41 | 49 53 20 46 75 6c 6c 20 |f the AA|IS Full |
|00000a50| 43 6f 6e 74 72 6f 6c 20 | 50 72 6f 6c 6f 67 20 6d |Control |Prolog m|
|00000a60| 61 6e 75 61 6c 2e 0d 20 | 2a 20 54 68 69 73 20 76 |anual.. |* This v|
|00000a70| 65 72 73 69 6f 6e 20 64 | 69 66 66 65 72 73 20 66 |ersion d|iffers f|
|00000a80| 72 6f 6d 20 74 68 65 20 | 6d 61 6e 75 61 6c 20 69 |rom the |manual i|
|00000a90| 6e 20 77 68 61 74 20 69 | 74 20 64 6f 65 73 2c 20 |n what i|t does, |
|00000aa0| 62 75 74 0d 20 2a 20 69 | 74 20 61 63 63 6f 6d 70 |but. * i|t accomp|
|00000ab0| 6c 69 73 68 65 73 20 74 | 68 65 20 73 61 6d 65 20 |lishes t|he same |
|00000ac0| 64 65 73 69 72 65 64 20 | 65 66 66 65 63 74 2e 0d |desired |effect..|
|00000ad0| 20 2a 20 54 68 65 20 6d | 61 6e 75 61 6c 20 61 6c | * The m|anual al|
|00000ae0| 73 6f 20 68 61 73 20 73 | 6f 6d 65 20 65 72 72 6f |so has s|ome erro|
|00000af0| 72 73 20 74 68 61 74 20 | 73 68 6f 75 6c 64 20 62 |rs that |should b|
|00000b00| 65 20 6f 62 76 69 6f 75 | 73 0d 20 2a 20 75 70 6f |e obviou|s. * upo|
|00000b10| 6e 20 65 78 61 6d 69 6e | 69 61 74 69 6f 6e 2e 20 |n examin|iation. |
|00000b20| 20 54 68 65 72 65 20 6e | 65 65 64 73 20 74 6f 20 | There n|eeds to |
|00000b30| 62 65 20 61 6e 6f 74 68 | 65 72 20 61 72 67 75 6d |be anoth|er argum|
|00000b40| 65 6e 74 20 74 6f 0d 20 | 2a 20 73 65 6e 64 5f 61 |ent to. |* send_a|
|00000b50| 70 70 6c 65 5f 65 76 65 | 6e 74 2c 20 61 6e 64 20 |pple_eve|nt, and |
|00000b60| 74 68 65 20 73 74 72 69 | 6e 67 20 63 6f 6d 6d 61 |the stri|ng comma|
|00000b70| 6e 64 73 20 6e 65 65 64 | 73 20 74 6f 20 68 61 76 |nds need|s to hav|
|00000b80| 65 20 3f 2d 20 69 6e 73 | 69 64 65 0d 20 2a 20 69 |e ?- ins|ide. * i|
|00000b90| 74 20 74 6f 20 6d 61 6b | 65 20 74 68 65 20 72 75 |t to mak|e the ru|
|00000ba0| 6e 5f 67 6f 61 6c 20 61 | 63 74 75 61 6c 6c 79 20 |n_goal a|ctually |
|00000bb0| 61 20 67 6f 61 6c 2e 0d | 20 2a 0d 20 2a 20 54 68 |a goal..| *. * Th|
|00000bc0| 69 73 20 76 65 72 73 69 | 6f 6e 20 6f 6e 6c 79 20 |is versi|on only |
|00000bd0| 73 65 6e 64 73 20 6f 6e | 65 20 70 72 6f 6c 6f 67 |sends on|e prolog|
|00000be0| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 61 74 20 61 | express|ion at a|
|00000bf0| 20 74 69 6d 65 2e 0d 20 | 2a 20 54 68 65 20 65 78 | time.. |* The ex|
|00000c00| 70 72 65 73 73 69 6f 6e | 20 69 73 20 73 65 6e 74 |pression| is sent|
|00000c10| 20 69 6e 20 73 74 72 69 | 6e 67 20 66 6f 72 6d 20 | in stri|ng form |
|00000c20| 61 6e 64 20 6e 65 65 64 | 73 20 74 6f 20 62 65 20 |and need|s to be |
|00000c30| 63 6f 6e 76 65 72 74 65 | 64 0d 20 2a 20 77 69 74 |converte|d. * wit|
|00000c40| 68 20 73 74 72 69 6e 67 | 2f 32 20 74 6f 20 61 20 |h string|/2 to a |
|00000c50| 50 72 6f 6c 6f 67 20 67 | 6f 61 6c 2e 0d 20 2a 0d |Prolog g|oal.. *.|
|00000c60| 20 2a 20 43 6c 61 73 73 | 3a 20 09 60 70 72 6c 67 | * Class|: .`prlg|
|00000c70| 60 0d 20 2a 20 49 64 3a | 09 09 60 61 73 72 74 60 |`. * Id:|..`asrt`|
|00000c80| 09 28 41 73 73 65 72 74 | 69 6f 6e 29 0d 20 2a 20 |.(Assert|ion). * |
|00000c90| 49 64 3a 09 09 60 71 75 | 65 72 60 09 28 51 75 65 |Id:..`qu|er`.(Que|
|00000ca0| 72 79 29 0d 20 2a 20 50 | 61 72 61 6d 65 74 65 72 |ry). * P|arameter|
|00000cb0| 73 3a 09 60 70 72 6c 67 | 60 20 3d 20 73 74 72 69 |s:.`prlg|` = stri|
|00000cc0| 6e 67 0d 20 2a 2f 0d 2f | 2a 0d 20 2a 0d 20 2a 20 |ng. */./|*. *. * |
|00000cd0| 41 6e 20 41 70 70 6c 65 | 20 45 76 65 6e 74 20 48 |An Apple| Event H|
|00000ce0| 6f 6f 6b 20 66 6f 72 20 | 72 65 63 69 65 76 69 6e |ook for |recievin|
|00000cf0| 67 20 61 73 73 65 72 74 | 69 6f 6e 20 63 6f 6d 6d |g assert|ion comm|
|00000d00| 61 6e 64 73 2e 0d 20 2a | 0d 20 2a 0d 20 2a 20 74 |ands.. *|. *. * t|
|00000d10| 68 65 72 65 20 69 73 20 | 6f 6e 65 20 70 61 72 61 |here is |one para|
|00000d20| 6d 65 74 65 72 20 60 2d | 2d 2d 2d 60 2e 20 20 49 |meter `-|---`. I|
|00000d30| 74 20 69 73 20 61 6e 20 | 61 70 70 6c 65 20 64 65 |t is an |apple de|
|00000d40| 73 63 72 69 70 74 6f 72 | 20 6f 66 0d 20 2a 09 74 |scriptor| of. *.t|
|00000d50| 79 70 65 20 60 54 45 58 | 54 60 2e 20 20 57 65 20 |ype `TEX|T`. We |
|00000d60| 61 73 6b 20 70 72 6f 6c | 6f 67 20 74 6f 20 63 6f |ask prol|og to co|
|00000d70| 6e 76 65 72 74 20 69 74 | 20 61 75 74 6f 6d 61 74 |nvert it| automat|
|00000d80| 69 63 61 6c 6c 79 20 74 | 6f 0d 20 2a 09 61 20 73 |ically t|o. *.a s|
|00000d90| 74 72 69 6e 67 2e 20 20 | 70 61 72 61 6d 28 60 2d |tring. |param(`-|
|00000da0| 2d 2d 2d 60 29 20 6f 72 | 20 70 61 72 61 6d 28 60 |---`) or| param(`|
|00000db0| 2d 2d 2d 2d 60 2c 20 73 | 74 72 69 6e 67 29 0d 20 |----`, s|tring). |
|00000dc0| 2a 09 77 6f 75 6c 64 20 | 68 61 76 65 20 64 6f 6e |*.would |have don|
|00000dd0| 65 20 74 68 65 20 73 61 | 6d 65 2e 0d 20 2a 20 54 |e the sa|me.. * T|
|00000de0| 68 75 73 2c 20 76 61 6c | 75 65 20 77 69 6c 6c 20 |hus, val|ue will |
|00000df0| 62 65 20 72 65 70 6c 61 | 63 65 64 20 77 69 74 68 |be repla|ced with|
|00000e00| 20 74 68 65 20 73 74 72 | 69 6e 67 20 62 65 69 6e | the str|ing bein|
|00000e10| 67 0d 20 2a 09 70 61 73 | 73 65 64 20 69 6e 20 74 |g. *.pas|sed in t|
|00000e20| 68 65 20 41 70 70 6c 65 | 20 45 76 65 6e 74 20 77 |he Apple| Event w|
|00000e30| 68 65 6e 20 74 68 69 73 | 20 61 70 70 6c 65 20 65 |hen this| apple e|
|00000e40| 76 65 6e 74 20 68 6f 6f | 6b 20 69 73 20 63 61 6c |vent hoo|k is cal|
|00000e50| 6c 65 64 2e 0d 20 2a 2f | 0d 3a 2d 20 64 65 66 69 |led.. */|.:- defi|
|00000e60| 6e 65 5f 61 70 70 6c 65 | 5f 65 76 65 6e 74 28 60 |ne_apple|_event(`|
|00000e70| 70 72 6c 67 60 2c 20 60 | 61 73 72 74 60 2c 20 0d |prlg`, `|asrt`, .|
|00000e80| 09 70 72 6f 63 65 73 73 | 5f 61 65 5f 61 73 73 65 |.process|_ae_asse|
|00000e90| 72 74 28 76 61 6c 75 65 | 2c 20 72 65 70 6c 79 5f |rt(value|, reply_|
|00000ea0| 76 61 6c 75 65 29 29 2e | 0d 09 0d 2f 2a 0d 20 2a |value)).|.../*. *|
|00000eb0| 20 54 68 65 20 66 75 6e | 63 74 69 6f 6e 20 65 78 | The fun|ction ex|
|00000ec0| 65 63 75 74 65 64 20 77 | 68 65 6e 20 61 6e 20 61 |ecuted w|hen an a|
|00000ed0| 70 70 6c 65 20 65 76 65 | 6e 74 20 69 73 20 72 65 |pple eve|nt is re|
|00000ee0| 63 65 69 76 65 64 20 74 | 6f 0d 20 2a 20 6d 61 6b |ceived t|o. * mak|
|00000ef0| 65 20 61 6e 20 61 73 73 | 65 72 74 69 6f 6e 2e 0d |e an ass|ertion..|
|00000f00| 20 2a 2f 0d 70 72 6f 63 | 65 73 73 5f 61 65 5f 61 | */.proc|ess_ae_a|
|00000f10| 73 73 65 72 74 28 53 74 | 72 69 6e 67 2c 20 30 29 |ssert(St|ring, 0)|
|00000f20| 20 3a 2d 0d 09 72 6e 6f | 74 69 63 65 5f 74 69 6d | :-..rno|tice_tim|
|00000f30| 65 73 74 61 6d 70 2c 0d | 09 72 6e 6f 74 69 63 65 |estamp,.|.rnotice|
|00000f40| 28 22 52 65 63 65 69 76 | 65 64 20 61 73 73 65 72 |("Receiv|ed asser|
|00000f50| 74 20 63 6f 6d 6d 61 6e | 64 3a 22 29 2c 0d 09 73 |t comman|d:"),..s|
|00000f60| 74 72 69 6e 67 28 41 73 | 73 65 72 74 69 6f 6e 2c |tring(As|sertion,|
|00000f70| 20 53 74 72 69 6e 67 29 | 2c 0d 09 72 6e 6f 74 69 | String)|,..rnoti|
|00000f80| 63 65 28 22 4d 61 6b 69 | 6e 67 20 74 68 65 20 41 |ce("Maki|ng the A|
|00000f90| 73 73 65 72 74 69 6f 6e | 2e 2e 2e 22 29 2c 0d 09 |ssertion|..."),..|
|00000fa0| 72 70 70 6e 6f 74 69 63 | 65 28 41 73 73 65 72 74 |rppnotic|e(Assert|
|00000fb0| 69 6f 6e 29 2c 0d 09 61 | 73 73 65 72 74 28 41 73 |ion),..a|ssert(As|
|00000fc0| 73 65 72 74 69 6f 6e 29 | 2c 0d 09 21 2c 0d 09 72 |sertion)|,..!,..r|
|00000fd0| 6e 6f 74 69 63 65 28 22 | 46 69 6e 69 73 68 65 64 |notice("|Finished|
|00000fe0| 20 61 73 73 65 72 74 69 | 6f 6e 2e 20 22 29 2c 0d | asserti|on. "),.|
|00000ff0| 09 72 6e 6f 74 69 63 65 | 28 22 53 75 63 63 65 73 |.rnotice|("Succes|
|00001000| 73 66 75 6c 21 22 29 2e | 0d 70 72 6f 63 65 73 73 |sful!").|.process|
|00001010| 5f 61 65 5f 61 73 73 65 | 72 74 28 5f 53 74 72 69 |_ae_asse|rt(_Stri|
|00001020| 6e 67 2c 20 2d 31 29 20 | 3a 2d 0d 09 72 6e 6f 74 |ng, -1) |:-..rnot|
|00001030| 69 63 65 28 22 41 73 73 | 65 72 74 69 6f 6e 20 66 |ice("Ass|ertion f|
|00001040| 61 69 6c 65 64 2e 20 22 | 29 2c 0d 09 72 6e 6f 74 |ailed. "|),..rnot|
|00001050| 69 63 65 28 22 55 6e 73 | 75 63 63 65 73 73 66 75 |ice("Uns|uccessfu|
|00001060| 6c 21 22 29 2e 0d 09 20 | 0d 2f 2a 0d 20 2a 20 61 |l!")... |./*. * a|
|00001070| 65 41 73 73 65 72 74 20 | 2d 2d 20 50 72 6f 6d 70 |eAssert |-- Promp|
|00001080| 74 20 66 6f 72 20 61 20 | 66 61 63 74 2f 72 75 6c |t for a |fact/rul|
|00001090| 65 20 61 6e 64 20 74 68 | 65 6e 20 61 73 73 65 72 |e and th|en asser|
|000010a0| 74 20 69 74 20 76 69 61 | 0d 20 2a 09 61 70 70 6c |t it via|. *.appl|
|000010b0| 65 20 65 76 65 6e 74 73 | 20 69 6e 74 6f 20 50 72 |e events| into Pr|
|000010c0| 6f 6c 6f 67 2e 0d 20 2a | 20 61 65 41 73 73 65 72 |olog.. *| aeAsser|
|000010d0| 74 28 46 61 63 74 29 20 | 2d 2d 20 41 73 73 65 72 |t(Fact) |-- Asser|
|000010e0| 74 20 74 68 65 20 73 70 | 65 63 69 66 69 65 64 20 |t the sp|ecified |
|000010f0| 66 61 63 74 2f 72 75 6c | 65 20 69 6e 74 6f 20 41 |fact/rul|e into A|
|00001100| 70 70 6c 65 20 45 76 65 | 6e 74 73 2e 0d 20 2a 2f |pple Eve|nts.. */|
|00001110| 0d 61 65 41 73 73 65 72 | 74 20 3a 2d 0d 09 74 74 |.aeAsser|t :-..tt|
|00001120| 79 70 72 69 6e 74 73 74 | 72 69 6e 67 28 22 5c 6e |yprintst|ring("\n|
|00001130| 45 6e 74 65 72 20 61 20 | 66 61 63 74 20 6f 72 20 |Enter a |fact or |
|00001140| 72 75 6c 65 20 74 6f 20 | 61 73 73 65 72 74 3a 20 |rule to |assert: |
|00001150| 5c 6e 5c 6e 22 29 2c 0d | 09 74 74 79 72 65 61 64 |\n\n"),.|.ttyread|
|00001160| 28 46 61 63 74 29 2c 0d | 09 61 65 41 73 73 65 72 |(Fact),.|.aeAsser|
|00001170| 74 28 46 61 63 74 29 2e | 0d 09 0d 61 65 41 73 73 |t(Fact).|...aeAss|
|00001180| 65 72 74 28 46 61 63 74 | 29 20 3a 2d 0d 09 73 74 |ert(Fact|) :-..st|
|00001190| 72 69 6e 67 71 28 46 61 | 63 74 2c 20 53 74 72 69 |ringq(Fa|ct, Stri|
|000011a0| 6e 67 29 2c 0d 09 61 65 | 41 73 73 65 72 74 28 46 |ng),..ae|Assert(F|
|000011b0| 61 63 74 2c 20 53 74 72 | 69 6e 67 29 2e 0d 0d 61 |act, Str|ing)...a|
|000011c0| 65 41 73 73 65 72 74 28 | 46 61 63 74 2c 20 53 74 |eAssert(|Fact, St|
|000011d0| 72 69 6e 67 29 20 3a 2d | 0d 09 6e 6f 74 69 63 65 |ring) :-|..notice|
|000011e0| 28 22 43 72 65 61 74 69 | 6e 67 20 63 6f 6d 6d 61 |("Creati|ng comma|
|000011f0| 6e 64 2e 2e 2e 22 29 2c | 0d 09 73 74 72 69 6e 67 |nd..."),|..string|
|00001200| 71 28 46 61 63 74 2c 20 | 53 74 72 69 6e 67 29 2c |q(Fact, |String),|
|00001210| 0d 09 63 68 65 63 6b 69 | 6e 67 5f 66 6f 72 5f 66 |..checki|ng_for_f|
|00001220| 61 63 74 28 46 61 63 74 | 29 2c 0d 09 6e 6f 74 69 |act(Fact|),..noti|
|00001230| 63 65 5f 74 69 6d 65 73 | 74 61 6d 70 2c 0d 09 6e |ce_times|tamp,..n|
|00001240| 6f 74 69 63 65 28 22 53 | 65 6e 64 69 6e 67 20 61 |otice("S|ending a|
|00001250| 73 73 65 72 74 69 6f 6e | 20 74 6f 20 22 29 2c 0d |ssertion| to "),.|
|00001260| 09 67 65 74 5f 67 6c 6f | 62 61 6c 28 70 72 6f 6c |.get_glo|bal(prol|
|00001270| 6f 67 5f 74 61 6c 6b 69 | 6e 67 5f 77 69 74 68 2c |og_talki|ng_with,|
|00001280| 20 50 72 6f 6c 6f 67 50 | 72 6f 63 65 73 73 29 2c | PrologP|rocess),|
|00001290| 0d 09 28 50 72 6f 6c 6f | 67 50 72 6f 63 65 73 73 |..(Prolo|gProcess|
|000012a0| 20 3d 20 22 41 49 46 43 | 22 20 2d 3e 20 6e 6f 74 | = "AIFC|" -> not|
|000012b0| 69 63 65 28 22 74 68 69 | 73 20 70 72 6f 6c 6f 67 |ice("thi|s prolog|
|000012c0| 20 73 65 73 73 69 6f 6e | 22 29 0d 09 3b 6e 6f 74 | session|")..;not|
|000012d0| 69 63 65 5f 6e 6f 6e 6c | 28 22 72 65 6d 6f 74 65 |ice_nonl|("remote|
|000012e0| 20 70 72 6f 6c 6f 67 20 | 73 65 73 73 69 6f 6e 3a | prolog |session:|
|000012f0| 20 22 29 2c 0d 09 20 6e | 6f 74 69 63 65 28 50 72 | "),.. n|otice(Pr|
|00001300| 6f 6c 6f 67 50 72 6f 63 | 65 73 73 29 0d 09 29 2c |ologProc|ess)..),|
|00001310| 0d 09 70 70 6e 6f 74 69 | 63 65 28 46 61 63 74 29 |..ppnoti|ce(Fact)|
|00001320| 2c 0d 09 67 65 74 5f 67 | 6c 6f 62 61 6c 28 72 65 |,..get_g|lobal(re|
|00001330| 70 6c 79 5f 6d 6f 64 65 | 2c 20 52 65 70 6c 79 4d |ply_mode|, ReplyM|
|00001340| 6f 64 65 29 2c 0d 09 28 | 52 65 70 6c 79 4d 6f 64 |ode),..(|ReplyMod|
|00001350| 65 20 3d 20 77 61 69 74 | 5f 72 65 70 6c 79 20 2d |e = wait|_reply -|
|00001360| 3e 20 6e 6f 74 69 63 65 | 28 22 57 61 69 74 69 6e |> notice|("Waitin|
|00001370| 67 20 66 6f 72 20 72 65 | 70 6c 79 2e 2e 2e 22 29 |g for re|ply...")|
|00001380| 0d 09 3b 52 65 70 6c 79 | 4d 6f 64 65 20 3d 20 71 |..;Reply|Mode = q|
|00001390| 75 65 75 65 5f 72 65 70 | 6c 79 20 2d 3e 20 6e 6f |ueue_rep|ly -> no|
|000013a0| 74 69 63 65 28 22 53 65 | 6e 64 2e 20 20 52 65 70 |tice("Se|nd. Rep|
|000013b0| 6c 79 20 77 69 6c 6c 20 | 62 65 20 71 75 65 75 65 |ly will |be queue|
|000013c0| 64 2e 2e 2e 22 29 0d 09 | 3b 52 65 70 6c 79 4d 6f |d...")..|;ReplyMo|
|000013d0| 64 65 20 3d 20 6e 6f 5f | 72 65 70 6c 79 20 2d 3e |de = no_|reply ->|
|000013e0| 20 6e 6f 74 69 63 65 28 | 22 4e 6f 20 72 65 70 6c | notice(|"No repl|
|000013f0| 79 20 69 73 20 72 65 71 | 75 65 73 74 65 64 2e 22 |y is req|uested."|
|00001400| 29 0d 09 29 2c 0d 09 73 | 65 6e 64 5f 61 70 70 6c |)..),..s|end_appl|
|00001410| 65 5f 65 76 65 6e 74 28 | 50 72 6f 6c 6f 67 50 72 |e_event(|PrologPr|
|00001420| 6f 63 65 73 73 2c 20 60 | 70 72 6c 67 60 2c 20 60 |ocess, `|prlg`, `|
|00001430| 61 73 72 74 60 2c 20 5b | 5d 2c 0d 09 09 5b 60 2d |asrt`, [|],...[`-|
|00001440| 2d 2d 2d 60 20 3d 20 53 | 74 72 69 6e 67 5d 2c 0d |---` = S|tring],.|
|00001450| 09 09 5b 52 65 70 6c 79 | 4d 6f 64 65 2c 20 6e 65 |..[Reply|Mode, ne|
|00001460| 76 65 72 5f 69 6e 74 65 | 72 61 63 74 5d 2c 0d 09 |ver_inte|ract],..|
|00001470| 09 28 70 72 6f 63 65 73 | 73 5f 61 65 5f 72 65 70 |.(proces|s_ae_rep|
|00001480| 6c 79 28 72 65 70 6c 79 | 5f 76 61 6c 75 65 2c 20 |ly(reply|_value, |
|00001490| 61 73 73 65 72 74 28 46 | 61 63 74 29 29 2c 0d 09 |assert(F|act)),..|
|000014a0| 09 20 63 68 65 63 6b 69 | 6e 67 5f 66 6f 72 5f 66 |. checki|ng_for_f|
|000014b0| 61 63 74 28 46 61 63 74 | 29 29 2c 20 5f 52 65 73 |act(Fact|)), _Res|
|000014c0| 75 6c 74 29 2e 0d 09 09 | 0d 2f 2a 0d 20 2a 20 4f |ult)....|./*. * O|
|000014d0| 6e 6c 79 20 63 68 65 63 | 6b 20 66 6f 72 20 74 68 |nly chec|k for th|
|000014e0| 65 20 66 61 63 74 20 77 | 68 65 6e 20 77 65 20 73 |e fact w|hen we s|
|000014f0| 65 6e 64 20 74 68 65 20 | 61 70 70 6c 65 20 65 76 |end the |apple ev|
|00001500| 65 6e 74 20 74 6f 0d 20 | 2a 20 74 68 69 73 20 73 |ent to. |* this s|
|00001510| 61 6d 65 20 50 72 6f 6c | 6f 67 2e 0d 20 2a 2f 0d |ame Prol|og.. */.|
|00001520| 63 68 65 63 6b 69 6e 67 | 5f 66 6f 72 5f 66 61 63 |checking|_for_fac|
|00001530| 74 28 5f 46 61 63 74 29 | 20 3a 2d 0d 09 6e 6f 74 |t(_Fact)| :-..not|
|00001540| 28 67 65 74 5f 67 6c 6f | 62 61 6c 28 70 72 6f 6c |(get_glo|bal(prol|
|00001550| 6f 67 5f 74 61 6c 6b 69 | 6e 67 5f 77 69 74 68 2c |og_talki|ng_with,|
|00001560| 20 22 41 49 46 43 22 29 | 29 2c 0d 09 21 2c 0d 09 | "AIFC")|),..!,..|
|00001570| 74 72 75 65 2e 0d 63 68 | 65 63 6b 69 6e 67 5f 66 |true..ch|ecking_f|
|00001580| 6f 72 5f 66 61 63 74 28 | 46 61 63 74 29 20 3a 2d |or_fact(|Fact) :-|
|00001590| 0d 09 6e 6f 74 69 63 65 | 28 22 43 68 65 63 6b 69 |..notice|("Checki|
|000015a0| 6e 67 20 50 72 6f 6c 6f | 67 20 66 6f 72 20 66 61 |ng Prolo|g for fa|
|000015b0| 63 74 2f 72 75 6c 65 3a | 20 22 29 2c 0d 09 70 70 |ct/rule:| "),..pp|
|000015c0| 6e 6f 74 69 63 65 28 46 | 61 63 74 29 2c 0d 09 3f |notice(F|act),..?|
|000015d0| 28 46 61 63 74 29 2c 0d | 09 21 2c 0d 09 6e 6f 74 |(Fact),.|.!,..not|
|000015e0| 69 63 65 28 22 46 61 63 | 74 20 77 61 73 20 66 6f |ice("Fac|t was fo|
|000015f0| 75 6e 64 21 2e 22 29 2e | 0d 63 68 65 63 6b 69 6e |und!.").|.checkin|
|00001600| 67 5f 66 6f 72 5f 66 61 | 63 74 28 5f 29 20 3a 2d |g_for_fa|ct(_) :-|
|00001610| 0d 09 6e 6f 74 69 63 65 | 28 22 46 61 63 74 20 69 |..notice|("Fact i|
|00001620| 73 20 6e 6f 74 20 66 6f | 75 6e 64 2e 22 29 2e 0d |s not fo|und.")..|
|00001630| 0d 2f 2a 0d 20 2a 20 53 | 69 6d 70 6c 65 20 66 75 |./*. * S|imple fu|
|00001640| 6e 63 74 69 6f 6e 20 66 | 6f 72 20 6e 6f 74 69 66 |nction f|or notif|
|00001650| 69 63 61 74 69 6f 6e 20 | 61 62 6f 75 74 20 68 6f |ication |about ho|
|00001660| 77 20 74 68 65 0d 20 2a | 20 61 70 70 6c 65 20 65 |w the. *| apple e|
|00001670| 76 65 6e 74 20 66 61 72 | 65 64 2e 0d 20 2a 2f 0d |vent far|ed.. */.|
|00001680| 70 72 6f 63 65 73 73 5f | 61 65 5f 72 65 70 6c 79 |process_|ae_reply|
|00001690| 28 52 65 70 6c 79 56 61 | 6c 75 65 2c 20 41 63 74 |(ReplyVa|lue, Act|
|000016a0| 69 6f 6e 29 20 3a 2d 0d | 09 6e 6f 74 69 63 65 5f |ion) :-.|.notice_|
|000016b0| 74 69 6d 65 73 74 61 6d | 70 2c 0d 09 6e 6f 74 69 |timestam|p,..noti|
|000016c0| 63 65 5f 6e 6f 6e 6c 28 | 22 52 65 70 6c 79 20 61 |ce_nonl(|"Reply a|
|000016d0| 72 72 69 76 65 64 20 66 | 6f 72 3a 22 29 2c 0d 09 |rrived f|or:"),..|
|000016e0| 6e 6f 74 69 63 65 28 41 | 63 74 69 6f 6e 29 2c 0d |notice(A|ction),.|
|000016f0| 09 72 65 70 6c 79 5f 65 | 72 72 6f 72 28 52 65 70 |.reply_e|rror(Rep|
|00001700| 6c 79 56 61 6c 75 65 2c | 20 52 65 70 6c 79 53 74 |lyValue,| ReplySt|
|00001710| 72 69 6e 67 29 2c 0d 09 | 6e 6f 74 69 63 65 28 52 |ring),..|notice(R|
|00001720| 65 70 6c 79 53 74 72 69 | 6e 67 29 2e 0d 09 0d 72 |eplyStri|ng)....r|
|00001730| 65 70 6c 79 5f 65 72 72 | 6f 72 28 30 2c 20 22 43 |eply_err|or(0, "C|
|00001740| 6f 6d 6d 61 6e 64 20 77 | 61 73 20 73 75 63 63 65 |ommand w|as succe|
|00001750| 73 73 66 75 6c 21 22 29 | 20 3a 2d 20 21 2e 0d 72 |ssful!")| :- !..r|
|00001760| 65 70 6c 79 5f 65 72 72 | 6f 72 28 2d 31 2c 20 22 |eply_err|or(-1, "|
|00001770| 41 73 73 65 72 74 69 6f | 6e 20 66 61 69 6c 65 64 |Assertio|n failed|
|00001780| 2e 22 29 20 3a 2d 20 21 | 2e 0d 72 65 70 6c 79 5f |.") :- !|..reply_|
|00001790| 65 72 72 6f 72 28 2d 32 | 2c 20 22 51 75 65 72 79 |error(-2|, "Query|
|000017a0| 20 66 61 69 6c 65 64 2e | 20 20 4e 6f 20 61 6e 73 | failed.| No ans|
|000017b0| 77 65 72 73 2e 22 29 20 | 3a 2d 20 21 2e 0d 72 65 |wers.") |:- !..re|
|000017c0| 70 6c 79 5f 65 72 72 6f | 72 28 2d 32 38 2c 20 22 |ply_erro|r(-28, "|
|000017d0| 43 61 6e 6e 6f 74 20 6c | 6f 67 20 69 6e 20 74 6f |Cannot l|og in to|
|000017e0| 20 74 68 65 20 72 65 6d | 6f 74 65 20 6d 61 63 68 | the rem|ote mach|
|000017f0| 69 6e 65 2e 22 29 20 3a | 2d 20 21 2e 0d 72 65 70 |ine.") :|- !..rep|
|00001800| 6c 79 5f 65 72 72 6f 72 | 28 2d 31 37 30 38 2c 20 |ly_error|(-1708, |
|00001810| 22 41 70 70 6c 65 20 45 | 76 65 6e 74 20 77 61 73 |"Apple E|vent was|
|00001820| 20 6e 6f 74 20 75 6e 64 | 65 72 73 74 6f 6f 64 2e | not und|erstood.|
|00001830| 22 29 20 3a 2d 20 21 2e | 0d 72 65 70 6c 79 5f 65 |") :- !.|.reply_e|
|00001840| 72 72 6f 72 28 2d 31 37 | 31 32 2c 20 22 41 70 70 |rror(-17|12, "App|
|00001850| 6c 65 20 45 76 65 6e 74 | 20 74 69 6d 65 64 20 6f |le Event| timed o|
|00001860| 75 74 2e 22 29 20 3a 2d | 20 21 2e 0d 72 65 70 6c |ut.") :-| !..repl|
|00001870| 79 5f 65 72 72 6f 72 28 | 45 72 72 6f 72 43 6f 64 |y_error(|ErrorCod|
|00001880| 65 2c 20 52 65 70 6c 79 | 53 74 72 69 6e 67 29 20 |e, Reply|String) |
|00001890| 3a 2d 0d 09 63 72 65 61 | 74 65 28 73 74 72 69 6e |:-..crea|te(strin|
|000018a0| 67 2c 20 52 65 70 6c 79 | 53 74 72 69 6e 67 29 2c |g, Reply|String),|
|000018b0| 0d 09 63 72 65 61 74 65 | 28 69 6f 5f 73 74 72 65 |..create|(io_stre|
|000018c0| 61 6d 2c 20 53 74 72 65 | 61 6d 2c 20 52 65 70 6c |am, Stre|am, Repl|
|000018d0| 79 53 74 72 69 6e 67 2c | 20 77 72 69 74 65 29 2c |yString,| write),|
|000018e0| 0d 09 66 6f 72 6d 61 74 | 28 53 74 72 65 61 6d 2c |..format|(Stream,|
|000018f0| 22 45 72 72 6f 72 20 43 | 6f 64 65 3a 20 25 64 22 |"Error C|ode: %d"|
|00001900| 2c 5b 45 72 72 6f 72 43 | 6f 64 65 5d 29 2c 0d 09 |,[ErrorC|ode]),..|
|00001910| 64 65 73 74 72 6f 79 28 | 53 74 72 65 61 6d 29 2e |destroy(|Stream).|
|00001920| 0d 0d 2f 2a 0d 20 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |../*. **|********|
|00001930| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001940| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001950| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001960| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0d |********|*******.|
|00001970| 20 2a 0d 20 2a 20 61 65 | 51 75 65 72 79 20 61 70 | *. * ae|Query ap|
|00001980| 70 6c 65 20 65 76 65 6e | 74 2e 0d 20 2a 09 41 20 |ple even|t.. *.A |
|00001990| 63 6f 6d 6d 61 6e 64 20 | 74 6f 20 72 75 6e 20 61 |command |to run a|
|000019a0| 20 50 72 6f 6c 6f 67 20 | 71 75 65 72 79 2e 0d 20 | Prolog |query.. |
|000019b0| 2a 09 51 75 65 72 79 20 | 69 73 20 70 61 73 73 65 |*.Query |is passe|
|000019c0| 64 20 61 73 20 61 20 73 | 74 72 69 6e 67 2c 20 73 |d as a s|tring, s|
|000019d0| 69 6d 69 6c 61 72 20 74 | 6f 20 60 61 73 72 74 60 |imilar t|o `asrt`|
|000019e0| 20 61 62 6f 76 65 2e 0d | 20 2a 09 52 65 70 6c 79 | above..| *.Reply|
|000019f0| 20 69 73 20 72 65 74 75 | 72 6e 65 64 20 69 6e 20 | is retu|rned in |
|00001a00| 72 65 70 6c 79 5f 70 61 | 72 61 6d 28 60 2d 2d 2d |reply_pa|ram(`---|
|00001a10| 2d 60 29 0d 20 2a 2f 0d | 3a 2d 20 64 65 66 69 6e |-`). */.|:- defin|
|00001a20| 65 5f 61 70 70 6c 65 5f | 65 76 65 6e 74 28 60 70 |e_apple_|event(`p|
|00001a30| 72 6c 67 60 2c 20 60 71 | 75 65 72 60 2c 0d 09 70 |rlg`, `q|uer`,..p|
|00001a40| 72 6f 63 65 73 73 5f 61 | 65 5f 71 75 65 72 79 28 |rocess_a|e_query(|
|00001a50| 76 61 6c 75 65 2c 20 72 | 65 70 6c 79 5f 70 61 72 |value, r|eply_par|
|00001a60| 61 6d 28 60 2d 2d 2d 2d | 60 29 2c 20 72 65 70 6c |am(`----|`), repl|
|00001a70| 79 5f 76 61 6c 75 65 29 | 29 2e 0d 0d 70 72 6f 63 |y_value)|)...proc|
|00001a80| 65 73 73 5f 61 65 5f 71 | 75 65 72 79 28 51 75 65 |ess_ae_q|uery(Que|
|00001a90| 72 79 53 74 72 69 6e 67 | 2c 20 56 61 72 56 61 6c |ryString|, VarVal|
|00001aa0| 75 65 73 2c 20 30 29 20 | 3a 2d 0d 09 73 74 72 69 |ues, 0) |:-..stri|
|00001ab0| 6e 67 28 51 75 65 72 79 | 2c 20 51 75 65 72 79 53 |ng(Query|, QueryS|
|00001ac0| 74 72 69 6e 67 29 2c 0d | 09 66 69 6e 64 5f 76 61 |tring),.|.find_va|
|00001ad0| 72 73 28 51 75 65 72 79 | 2c 20 56 61 72 73 29 2c |rs(Query|, Vars),|
|00001ae0| 0d 09 72 6e 6f 74 69 63 | 65 5f 6e 6f 6e 6c 28 22 |..rnotic|e_nonl("|
|00001af0| 22 29 2c 0d 09 72 6e 6f | 74 69 63 65 5f 74 69 6d |"),..rno|tice_tim|
|00001b00| 65 73 74 61 6d 70 2c 0d | 09 72 6e 6f 74 69 63 65 |estamp,.|.rnotice|
|00001b10| 28 22 52 65 63 65 69 76 | 65 64 20 51 75 65 72 79 |("Receiv|ed Query|
|00001b20| 3a 22 29 2c 0d 09 72 6e | 6f 74 69 63 65 28 51 75 |:"),..rn|otice(Qu|
|00001b30| 65 72 79 53 74 72 69 6e | 67 29 2c 0d 09 72 6e 6f |eryStrin|g),..rno|
|00001b40| 74 69 63 65 28 22 53 65 | 61 72 63 68 69 6e 67 20 |tice("Se|arching |
|00001b50| 66 6f 72 20 61 6c 6c 20 | 61 6e 73 77 65 72 73 2e |for all |answers.|
|00001b60| 2e 2e 22 29 2c 0d 09 62 | 61 67 6f 66 28 56 61 72 |.."),..b|agof(Var|
|00001b70| 73 2c 20 51 75 65 72 79 | 2c 20 56 61 72 56 61 6c |s, Query|, VarVal|
|00001b80| 75 65 4c 69 73 74 4c 69 | 73 74 29 2c 0d 09 72 6e |ueListLi|st),..rn|
|00001b90| 6f 74 69 63 65 28 22 51 | 75 65 72 79 20 77 61 73 |otice("Q|uery was|
|00001ba0| 20 73 75 63 63 65 73 73 | 66 75 6c 2e 20 20 22 29 | success|ful. ")|
|00001bb0| 2c 0d 09 72 6e 6f 74 69 | 63 65 28 22 52 65 74 75 |,..rnoti|ce("Retu|
|00001bc0| 72 6e 69 6e 67 20 61 6e | 73 77 65 72 73 3a 22 29 |rning an|swers:")|
|00001bd0| 2c 0d 09 6d 61 6b 65 5f | 73 74 72 69 6e 67 5f 76 |,..make_|string_v|
|00001be0| 61 6c 75 65 73 28 56 61 | 72 56 61 6c 75 65 4c 69 |alues(Va|rValueLi|
|00001bf0| 73 74 4c 69 73 74 2c 20 | 56 61 72 56 61 6c 75 65 |stList, |VarValue|
|00001c00| 73 29 2c 0d 09 66 69 6e | 64 5f 6e 61 6d 65 73 28 |s),..fin|d_names(|
|00001c10| 51 75 65 72 79 53 74 72 | 69 6e 67 2c 20 4e 61 6d |QueryStr|ing, Nam|
|00001c20| 65 4c 69 73 74 29 2c 0d | 09 72 65 70 6f 72 74 5f |eList),.|.report_|
|00001c30| 76 61 72 73 28 72 65 6d | 6f 74 65 5f 6e 6f 74 69 |vars(rem|ote_noti|
|00001c40| 63 65 5f 73 74 72 65 61 | 6d 2c 20 0d 09 09 51 75 |ce_strea|m, ...Qu|
|00001c50| 65 72 79 53 74 72 69 6e | 67 2c 20 4e 61 6d 65 4c |eryStrin|g, NameL|
|00001c60| 69 73 74 2c 20 56 61 72 | 56 61 6c 75 65 4c 69 73 |ist, Var|ValueLis|
|00001c70| 74 4c 69 73 74 29 2c 0d | 09 21 2e 0d 70 72 6f 63 |tList),.|.!..proc|
|00001c80| 65 73 73 5f 61 65 5f 71 | 75 65 72 79 28 51 75 65 |ess_ae_q|uery(Que|
|00001c90| 72 79 2c 20 5b 5d 2c 20 | 2d 32 29 20 3a 2d 0d 09 |ry, [], |-2) :-..|
|00001ca0| 72 6e 6f 74 69 63 65 5f | 6e 6f 6e 6c 28 22 51 75 |rnotice_|nonl("Qu|
|00001cb0| 65 72 79 20 66 61 69 6c | 65 64 3a 22 29 2c 0d 09 |ery fail|ed:"),..|
|00001cc0| 72 6e 6f 74 69 63 65 28 | 51 75 65 72 79 29 2e 0d |rnotice(|Query)..|
|00001cd0| 09 0d 6d 61 6b 65 5f 73 | 74 72 69 6e 67 5f 76 61 |..make_s|tring_va|
|00001ce0| 6c 75 65 73 28 5b 5d 2c | 20 5b 5d 29 2e 0d 6d 61 |lues([],| [])..ma|
|00001cf0| 6b 65 5f 73 74 72 69 6e | 67 5f 76 61 6c 75 65 73 |ke_strin|g_values|
|00001d00| 28 5b 41 6e 73 77 65 72 | 31 20 7c 20 4f 74 68 65 |([Answer|1 | Othe|
|00001d10| 72 41 6e 73 77 65 72 73 | 5d 2c 20 5b 53 74 72 69 |rAnswers|], [Stri|
|00001d20| 6e 67 31 20 7c 20 4f 74 | 68 65 72 53 74 72 69 6e |ng1 | Ot|herStrin|
|00001d30| 67 73 5d 29 20 3a 2d 0d | 09 6f 6e 65 5f 73 74 72 |gs]) :-.|.one_str|
|00001d40| 69 6e 67 5f 61 6e 73 77 | 65 72 5f 6c 69 73 74 28 |ing_answ|er_list(|
|00001d50| 41 6e 73 77 65 72 31 2c | 20 53 74 72 69 6e 67 31 |Answer1,| String1|
|00001d60| 29 2c 0d 09 6d 61 6b 65 | 5f 73 74 72 69 6e 67 5f |),..make|_string_|
|00001d70| 76 61 6c 75 65 73 28 4f | 74 68 65 72 41 6e 73 77 |values(O|therAnsw|
|00001d80| 65 72 73 2c 20 4f 74 68 | 65 72 53 74 72 69 6e 67 |ers, Oth|erString|
|00001d90| 73 29 2e 09 0d 09 0d 6f | 6e 65 5f 73 74 72 69 6e |s).....o|ne_strin|
|00001da0| 67 5f 61 6e 73 77 65 72 | 5f 6c 69 73 74 28 5b 5d |g_answer|_list([]|
|00001db0| 2c 20 5b 5d 29 2e 0d 6f | 6e 65 5f 73 74 72 69 6e |, [])..o|ne_strin|
|00001dc0| 67 5f 61 6e 73 77 65 72 | 5f 6c 69 73 74 28 5b 56 |g_answer|_list([V|
|00001dd0| 61 6c 75 65 20 7c 20 4f | 74 68 65 72 56 61 6c 75 |alue | O|therValu|
|00001de0| 65 73 5d 2c 20 5b 53 74 | 72 69 6e 67 20 7c 20 4f |es], [St|ring | O|
|00001df0| 74 68 65 72 53 74 72 69 | 6e 67 73 5d 29 20 3a 2d |therStri|ngs]) :-|
|00001e00| 0d 09 73 74 72 69 6e 67 | 71 28 56 61 6c 75 65 2c |..string|q(Value,|
|00001e10| 20 53 74 72 69 6e 67 29 | 2c 0d 09 6f 6e 65 5f 73 | String)|,..one_s|
|00001e20| 74 72 69 6e 67 5f 61 6e | 73 77 65 72 5f 6c 69 73 |tring_an|swer_lis|
|00001e30| 74 28 4f 74 68 65 72 56 | 61 6c 75 65 73 2c 20 4f |t(OtherV|alues, O|
|00001e40| 74 68 65 72 53 74 72 69 | 6e 67 73 29 2e 0d 09 0d |therStri|ngs)....|
|00001e50| 61 65 51 75 65 72 79 20 | 3a 2d 0d 09 74 74 79 70 |aeQuery |:-..ttyp|
|00001e60| 72 69 6e 74 73 74 72 69 | 6e 67 28 22 5c 6e 45 6e |rintstri|ng("\nEn|
|00001e70| 74 65 72 20 61 20 67 6f | 61 6c 20 74 6f 20 71 75 |ter a go|al to qu|
|00001e80| 65 72 79 3a 20 5c 6e 5c | 6e 22 29 2c 0d 09 74 74 |ery: \n\|n"),..tt|
|00001e90| 79 72 65 61 64 28 47 6f | 61 6c 29 2c 0d 09 73 74 |yread(Go|al),..st|
|00001ea0| 72 69 6e 67 71 28 47 6f | 61 6c 2c 20 53 74 72 69 |ringq(Go|al, Stri|
|00001eb0| 6e 67 29 2c 0d 09 61 65 | 51 75 65 72 79 28 53 74 |ng),..ae|Query(St|
|00001ec0| 72 69 6e 67 29 2e 0d 0d | 61 65 51 75 65 72 79 28 |ring)...|aeQuery(|
|00001ed0| 53 74 72 69 6e 67 29 20 | 3a 2d 0d 09 66 69 6e 64 |String) |:-..find|
|00001ee0| 5f 6e 61 6d 65 73 28 53 | 74 72 69 6e 67 2c 20 4e |_names(S|tring, N|
|00001ef0| 61 6d 65 4c 69 73 74 29 | 2c 0d 09 6e 6f 74 69 63 |ameList)|,..notic|
|00001f00| 65 28 22 43 72 65 61 74 | 69 6e 67 20 63 6f 6d 6d |e("Creat|ing comm|
|00001f10| 61 6e 64 2e 2e 2e 22 29 | 2c 0d 09 6e 6f 74 69 63 |and...")|,..notic|
|00001f20| 65 5f 74 69 6d 65 73 74 | 61 6d 70 2c 0d 09 6e 6f |e_timest|amp,..no|
|00001f30| 74 69 63 65 28 22 53 65 | 6e 64 69 6e 67 20 71 75 |tice("Se|nding qu|
|00001f40| 65 72 79 20 74 6f 20 22 | 29 2c 0d 09 67 65 74 5f |ery to "|),..get_|
|00001f50| 67 6c 6f 62 61 6c 28 70 | 72 6f 6c 6f 67 5f 74 61 |global(p|rolog_ta|
|00001f60| 6c 6b 69 6e 67 5f 77 69 | 74 68 2c 20 50 72 6f 6c |lking_wi|th, Prol|
|00001f70| 6f 67 50 72 6f 63 65 73 | 73 29 2c 0d 09 28 50 72 |ogProces|s),..(Pr|
|00001f80| 6f 6c 6f 67 50 72 6f 63 | 65 73 73 20 3d 20 22 41 |ologProc|ess = "A|
|00001f90| 49 46 43 22 20 2d 3e 20 | 6e 6f 74 69 63 65 28 22 |IFC" -> |notice("|
|00001fa0| 74 68 69 73 20 70 72 6f | 6c 6f 67 20 73 65 73 73 |this pro|log sess|
|00001fb0| 69 6f 6e 22 29 0d 09 3b | 6e 6f 74 69 63 65 5f 6e |ion")..;|notice_n|
|00001fc0| 6f 6e 6c 28 22 72 65 6d | 6f 74 65 20 70 72 6f 6c |onl("rem|ote prol|
|00001fd0| 6f 67 20 73 65 73 73 69 | 6f 6e 3a 20 22 29 2c 0d |og sessi|on: "),.|
|00001fe0| 09 20 6e 6f 74 69 63 65 | 28 50 72 6f 6c 6f 67 50 |. notice|(PrologP|
|00001ff0| 72 6f 63 65 73 73 29 0d | 09 29 2c 0d 09 6e 6f 74 |rocess).|.),..not|
|00002000| 69 63 65 28 53 74 72 69 | 6e 67 29 2c 0d 09 67 65 |ice(Stri|ng),..ge|
|00002010| 74 5f 67 6c 6f 62 61 6c | 28 72 65 70 6c 79 5f 6d |t_global|(reply_m|
|00002020| 6f 64 65 2c 20 52 65 70 | 6c 79 4d 6f 64 65 29 2c |ode, Rep|lyMode),|
|00002030| 0d 09 28 52 65 70 6c 79 | 4d 6f 64 65 20 3d 20 77 |..(Reply|Mode = w|
|00002040| 61 69 74 5f 72 65 70 6c | 79 20 2d 3e 20 6e 6f 74 |ait_repl|y -> not|
|00002050| 69 63 65 28 22 57 61 69 | 74 69 6e 67 20 66 6f 72 |ice("Wai|ting for|
|00002060| 20 72 65 70 6c 79 2e 2e | 2e 22 29 0d 09 3b 52 65 | reply..|.")..;Re|
|00002070| 70 6c 79 4d 6f 64 65 20 | 3d 20 71 75 65 75 65 5f |plyMode |= queue_|
|00002080| 72 65 70 6c 79 20 2d 3e | 20 6e 6f 74 69 63 65 28 |reply ->| notice(|
|00002090| 22 53 65 6e 64 2e 20 20 | 52 65 70 6c 79 20 77 69 |"Send. |Reply wi|
|000020a0| 6c 6c 20 62 65 20 71 75 | 65 75 65 64 2e 2e 2e 22 |ll be qu|eued..."|
|000020b0| 29 0d 09 3b 52 65 70 6c | 79 4d 6f 64 65 20 3d 20 |)..;Repl|yMode = |
|000020c0| 6e 6f 5f 72 65 70 6c 79 | 20 2d 3e 20 6e 6f 74 69 |no_reply| -> noti|
|000020d0| 63 65 28 22 4e 6f 20 72 | 65 70 6c 79 20 69 73 20 |ce("No r|eply is |
|000020e0| 72 65 71 75 65 73 74 65 | 64 2e 22 29 0d 09 29 2c |requeste|d.")..),|
|000020f0| 0d 09 73 65 6e 64 5f 61 | 70 70 6c 65 5f 65 76 65 |..send_a|pple_eve|
|00002100| 6e 74 28 50 72 6f 6c 6f | 67 50 72 6f 63 65 73 73 |nt(Prolo|gProcess|
|00002110| 2c 20 60 70 72 6c 67 60 | 2c 20 60 71 75 65 72 60 |, `prlg`|, `quer`|
|00002120| 2c 20 5b 5d 2c 0d 09 09 | 5b 60 2d 2d 2d 2d 60 20 |, [],...|[`----` |
|00002130| 3d 20 53 74 72 69 6e 67 | 5d 2c 0d 09 09 5b 52 65 |= String|],...[Re|
|00002140| 70 6c 79 4d 6f 64 65 2c | 20 6e 65 76 65 72 5f 69 |plyMode,| never_i|
|00002150| 6e 74 65 72 61 63 74 5d | 2c 0d 09 09 28 70 72 6f |nteract]|,...(pro|
|00002160| 63 65 73 73 5f 61 65 5f | 72 65 70 6c 79 28 72 65 |cess_ae_|reply(re|
|00002170| 70 6c 79 5f 76 61 6c 75 | 65 2c 20 53 74 72 69 6e |ply_valu|e, Strin|
|00002180| 67 29 2c 0d 09 09 20 62 | 6f 75 6e 64 28 76 61 6c |g),... b|ound(val|
|00002190| 75 65 29 20 2d 3e 20 0d | 09 09 20 09 72 65 70 6f |ue) -> .|.. .repo|
|000021a0| 72 74 5f 76 61 72 73 28 | 6e 6f 74 69 63 65 5f 73 |rt_vars(|notice_s|
|000021b0| 74 72 65 61 6d 2c 20 53 | 74 72 69 6e 67 2c 20 0d |tream, S|tring, .|
|000021c0| 09 09 09 09 4e 61 6d 65 | 4c 69 73 74 2c 20 76 61 |....Name|List, va|
|000021d0| 6c 75 65 29 29 2c 20 0d | 09 09 20 5f 52 65 73 75 |lue)), .|.. _Resu|
|000021e0| 6c 74 29 2e 0d 09 09 20 | 0d 72 65 70 6f 72 74 5f |lt).... |.report_|
|000021f0| 76 61 72 73 28 57 68 65 | 72 65 2c 20 47 6f 61 6c |vars(Whe|re, Goal|
|00002200| 53 74 72 69 6e 67 2c 20 | 56 61 72 4c 69 73 74 2c |String, |VarList,|
|00002210| 20 56 61 6c 75 65 4c 69 | 73 74 29 20 3a 2d 0d 09 | ValueLi|st) :-..|
|00002220| 6e 6f 74 28 56 61 6c 75 | 65 4c 69 73 74 20 3d 20 |not(Valu|eList = |
|00002230| 5b 5d 29 2c 0d 09 73 6e | 6f 74 69 63 65 28 57 68 |[]),..sn|otice(Wh|
|00002240| 65 72 65 2c 20 22 41 6e | 73 77 65 72 20 73 65 74 |ere, "An|swer set|
|00002250| 73 20 66 6f 72 3a 22 29 | 2c 0d 09 73 6e 6f 74 69 |s for:")|,..snoti|
|00002260| 63 65 28 57 68 65 72 65 | 2c 20 47 6f 61 6c 53 74 |ce(Where|, GoalSt|
|00002270| 72 69 6e 67 29 2c 0d 09 | 72 65 70 6f 72 74 5f 76 |ring),..|report_v|
|00002280| 61 72 73 31 28 57 68 65 | 72 65 2c 20 56 61 72 4c |ars1(Whe|re, VarL|
|00002290| 69 73 74 2c 20 56 61 6c | 75 65 4c 69 73 74 29 2e |ist, Val|ueList).|
|000022a0| 0d 72 65 70 6f 72 74 5f | 76 61 72 73 31 28 57 68 |.report_|vars1(Wh|
|000022b0| 65 72 65 2c 20 5f 56 61 | 72 4c 69 73 74 2c 20 5b |ere, _Va|rList, [|
|000022c0| 5d 29 20 3a 2d 0d 09 73 | 6e 6f 74 69 63 65 28 57 |]) :-..s|notice(W|
|000022d0| 68 65 72 65 2c 20 22 2d | 2d 2d 2d 2d 2d 2d 2d 2d |here, "-|--------|
|000022e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 22 29 2c 0d 09 21 2e |--------|-"),..!.|
|000022f0| 0d 72 65 70 6f 72 74 5f | 76 61 72 73 31 28 57 68 |.report_|vars1(Wh|
|00002300| 65 72 65 2c 20 56 61 72 | 4c 69 73 74 2c 20 5b 56 |ere, Var|List, [V|
|00002310| 61 6c 75 65 73 31 20 7c | 20 56 61 6c 75 65 73 4f |alues1 || ValuesO|
|00002320| 74 68 65 72 73 5d 29 20 | 3a 2d 0d 09 73 6e 6f 74 |thers]) |:-..snot|
|00002330| 69 63 65 28 57 68 65 72 | 65 2c 20 22 2d 2d 2d 2d |ice(Wher|e, "----|
|00002340| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 22 29 |--------|------")|
|00002350| 2c 0d 09 72 65 70 6f 72 | 74 5f 76 61 72 5f 76 61 |,..repor|t_var_va|
|00002360| 6c 75 65 73 28 57 68 65 | 72 65 2c 20 56 61 72 4c |lues(Whe|re, VarL|
|00002370| 69 73 74 2c 20 56 61 6c | 75 65 73 31 29 2c 0d 09 |ist, Val|ues1),..|
|00002380| 72 65 70 6f 72 74 5f 76 | 61 72 73 31 28 57 68 65 |report_v|ars1(Whe|
|00002390| 72 65 2c 20 56 61 72 4c | 69 73 74 2c 20 56 61 6c |re, VarL|ist, Val|
|000023a0| 75 65 73 4f 74 68 65 72 | 73 29 2e 0d 09 0d 72 65 |uesOther|s)....re|
|000023b0| 70 6f 72 74 5f 76 61 72 | 5f 76 61 6c 75 65 73 28 |port_var|_values(|
|000023c0| 5f 57 68 65 72 65 2c 20 | 5b 5d 2c 20 5b 5d 29 2e |_Where, |[], []).|
|000023d0| 0d 72 65 70 6f 72 74 5f | 76 61 72 5f 76 61 6c 75 |.report_|var_valu|
|000023e0| 65 73 28 57 68 65 72 65 | 2c 20 5b 56 61 72 31 20 |es(Where|, [Var1 |
|000023f0| 7c 20 56 61 72 4c 69 73 | 74 5d 2c 20 5b 56 61 6c || VarLis|t], [Val|
|00002400| 75 65 31 20 7c 20 56 61 | 6c 75 65 4c 69 73 74 5d |ue1 | Va|lueList]|
|00002410| 29 20 3a 2d 0d 09 67 65 | 74 5f 6e 6f 74 69 63 65 |) :-..ge|t_notice|
|00002420| 5f 73 74 72 65 61 6d 28 | 57 68 65 72 65 2c 20 4e |_stream(|Where, N|
|00002430| 6f 74 69 63 65 53 74 72 | 65 61 6d 29 2c 0d 09 28 |oticeStr|eam),..(|
|00002440| 73 74 72 69 6e 67 28 56 | 61 6c 75 65 31 29 20 2d |string(V|alue1) -|
|00002450| 3e 20 56 61 6c 75 65 53 | 74 72 69 6e 67 20 3d 20 |> ValueS|tring = |
|00002460| 56 61 6c 75 65 31 0d 09 | 3b 09 73 74 72 69 6e 67 |Value1..|;.string|
|00002470| 71 28 56 61 6c 75 65 31 | 2c 20 56 61 6c 75 65 53 |q(Value1|, ValueS|
|00002480| 74 72 69 6e 67 29 0d 09 | 29 2c 0d 09 66 6f 72 6d |tring)..|),..form|
|00002490| 61 74 28 4e 6f 74 69 63 | 65 53 74 72 65 61 6d 2c |at(Notic|eStream,|
|000024a0| 20 22 25 73 20 3d 20 25 | 73 22 2c 20 5b 56 61 72 | "%s = %|s", [Var|
|000024b0| 31 2c 20 56 61 6c 75 65 | 53 74 72 69 6e 67 5d 29 |1, Value|String])|
|000024c0| 2c 0d 09 28 56 61 6c 75 | 65 4c 69 73 74 20 5c 3d |,..(Valu|eList \=|
|000024d0| 20 5b 5d 20 2d 3e 20 73 | 6e 6f 74 69 63 65 28 57 | [] -> s|notice(W|
|000024e0| 68 65 72 65 2c 20 27 2c | 27 29 0d 09 3b 20 73 6e |here, ',|')..; sn|
|000024f0| 6f 74 69 63 65 28 57 68 | 65 72 65 2c 20 22 22 29 |otice(Wh|ere, "")|
|00002500| 0d 09 29 2c 0d 09 72 65 | 70 6f 72 74 5f 76 61 72 |..),..re|port_var|
|00002510| 5f 76 61 6c 75 65 73 28 | 57 68 65 72 65 2c 20 56 |_values(|Where, V|
|00002520| 61 72 4c 69 73 74 2c 20 | 56 61 6c 75 65 4c 69 73 |arList, |ValueLis|
|00002530| 74 29 2e 0d 09 0d 2f 2a | 0d 20 2a 20 57 65 20 6d |t)..../*|. * We m|
|00002540| 61 6b 65 20 61 20 6c 69 | 73 74 20 6f 66 20 74 68 |ake a li|st of th|
|00002550| 65 20 76 61 72 69 61 62 | 6c 65 73 20 73 6f 20 74 |e variab|les so t|
|00002560| 68 61 74 20 77 65 20 63 | 61 6e 20 71 75 65 72 79 |hat we c|an query|
|00002570| 20 61 62 6f 75 74 20 74 | 68 65 69 72 0d 20 2a 20 | about t|heir. * |
|00002580| 76 61 6c 75 65 73 20 61 | 66 74 65 72 77 61 72 64 |values a|fterward|
|00002590| 73 2e 0d 20 2a 2f 0d 66 | 69 6e 64 5f 76 61 72 73 |s.. */.f|ind_vars|
|000025a0| 28 47 6f 61 6c 2c 20 56 | 61 72 4c 69 73 74 29 20 |(Goal, V|arList) |
|000025b0| 3a 2d 0d 09 66 69 6e 64 | 5f 76 61 72 73 28 47 6f |:-..find|_vars(Go|
|000025c0| 61 6c 2c 20 5b 5d 2c 20 | 52 56 61 72 4c 69 73 74 |al, [], |RVarList|
|000025d0| 29 2c 0d 09 72 65 76 65 | 72 73 65 28 52 56 61 72 |),..reve|rse(RVar|
|000025e0| 4c 69 73 74 2c 20 56 61 | 72 4c 69 73 74 29 2e 0d |List, Va|rList)..|
|000025f0| 0d 66 69 6e 64 5f 76 61 | 72 73 28 47 6f 61 6c 2c |.find_va|rs(Goal,|
|00002600| 20 56 61 72 4c 69 73 74 | 2c 20 4e 65 77 56 61 72 | VarList|, NewVar|
|00002610| 4c 69 73 74 29 20 3a 2d | 0d 09 76 61 72 28 47 6f |List) :-|..var(Go|
|00002620| 61 6c 29 2c 0d 09 21 2c | 0d 09 28 27 6d 65 6d 62 |al),..!,|..('memb|
|00002630| 65 72 3d 3d 27 28 47 6f | 61 6c 2c 20 56 61 72 4c |er=='(Go|al, VarL|
|00002640| 69 73 74 29 20 2d 3e 20 | 4e 65 77 56 61 72 4c 69 |ist) -> |NewVarLi|
|00002650| 73 74 20 3d 20 56 61 72 | 4c 69 73 74 0d 09 3b 09 |st = Var|List..;.|
|00002660| 4e 65 77 56 61 72 4c 69 | 73 74 20 3d 20 5b 47 6f |NewVarLi|st = [Go|
|00002670| 61 6c 20 7c 20 56 61 72 | 4c 69 73 74 5d 0d 09 29 |al | Var|List]..)|
|00002680| 2e 0d 66 69 6e 64 5f 76 | 61 72 73 28 47 6f 61 6c |..find_v|ars(Goal|
|00002690| 2c 20 56 61 72 4c 69 73 | 74 2c 20 4e 65 77 56 61 |, VarLis|t, NewVa|
|000026a0| 72 4c 69 73 74 29 20 3a | 2d 0d 09 66 75 6e 63 74 |rList) :|-..funct|
|000026b0| 6f 72 28 47 6f 61 6c 2c | 20 5f 2c 20 41 72 69 74 |or(Goal,| _, Arit|
|000026c0| 79 29 2c 0d 09 66 69 6e | 64 5f 76 61 72 73 28 47 |y),..fin|d_vars(G|
|000026d0| 6f 61 6c 2c 20 56 61 72 | 4c 69 73 74 2c 20 4e 65 |oal, Var|List, Ne|
|000026e0| 77 56 61 72 4c 69 73 74 | 2c 20 41 72 69 74 79 29 |wVarList|, Arity)|
|000026f0| 2e 0d 66 69 6e 64 5f 76 | 61 72 73 28 5f 47 6f 61 |..find_v|ars(_Goa|
|00002700| 6c 2c 20 56 61 72 4c 69 | 73 74 2c 20 56 61 72 4c |l, VarLi|st, VarL|
|00002710| 69 73 74 2c 20 30 29 20 | 3a 2d 20 21 2e 0d 66 69 |ist, 0) |:- !..fi|
|00002720| 6e 64 5f 76 61 72 73 28 | 47 6f 61 6c 2c 20 56 61 |nd_vars(|Goal, Va|
|00002730| 72 4c 69 73 74 2c 20 4e | 65 77 56 61 72 4c 69 73 |rList, N|ewVarLis|
|00002740| 74 2c 20 4e 29 20 3a 2d | 0d 09 61 72 67 28 4e 2c |t, N) :-|..arg(N,|
|00002750| 20 47 6f 61 6c 2c 20 58 | 29 2c 0d 09 66 69 6e 64 | Goal, X|),..find|
|00002760| 5f 76 61 72 73 28 58 2c | 20 56 61 72 4c 69 73 74 |_vars(X,| VarList|
|00002770| 2c 20 56 61 72 4c 69 73 | 74 31 29 2c 0d 09 4e 31 |, VarLis|t1),..N1|
|00002780| 20 69 73 20 4e 20 2d 20 | 31 2c 0d 09 66 69 6e 64 | is N - |1,..find|
|00002790| 5f 76 61 72 73 28 47 6f | 61 6c 2c 20 56 61 72 4c |_vars(Go|al, VarL|
|000027a0| 69 73 74 31 2c 20 4e 65 | 77 56 61 72 4c 69 73 74 |ist1, Ne|wVarList|
|000027b0| 2c 20 4e 31 29 2e 0d 0d | 27 6d 65 6d 62 65 72 3d |, N1)...|'member=|
|000027c0| 3d 27 28 41 2c 5b 59 7c | 5f 5d 29 20 3a 2d 20 41 |='(A,[Y||_]) :- A|
|000027d0| 20 3d 3d 20 59 2c 21 2e | 0d 27 6d 65 6d 62 65 72 | == Y,!.|.'member|
|000027e0| 3d 3d 27 28 41 2c 5b 5f | 7c 5a 5d 29 20 3a 2d 20 |=='(A,[_||Z]) :- |
|000027f0| 27 6d 65 6d 62 65 72 3d | 3d 27 28 41 2c 5a 29 2e |'member=|='(A,Z).|
|00002800| 0d 0d 2f 2a 0d 20 2a 20 | 54 68 69 73 20 69 73 20 |../*. * |This is |
|00002810| 6a 75 73 74 20 61 20 71 | 75 69 63 6b 20 72 6f 75 |just a q|uick rou|
|00002820| 74 69 6e 65 2c 20 69 74 | 20 64 6f 65 73 20 6e 6f |tine, it| does no|
|00002830| 74 20 77 6f 72 6b 20 69 | 66 20 73 69 6e 67 6c 65 |t work i|f single|
|00002840| 20 71 75 6f 74 65 73 0d | 20 2a 20 61 72 65 20 75 | quotes.| * are u|
|00002850| 73 65 64 20 74 6f 20 6d | 61 6b 65 20 61 74 6f 6d |sed to m|ake atom|
|00002860| 73 2e 0d 20 2a 2f 0d 66 | 69 6e 64 5f 6e 61 6d 65 |s.. */.f|ind_name|
|00002870| 73 28 53 74 72 69 6e 67 | 2c 20 4e 61 6d 65 4c 69 |s(String|, NameLi|
|00002880| 73 74 29 20 3a 2d 0d 09 | 63 72 65 61 74 65 28 69 |st) :-..|create(i|
|00002890| 6f 5f 73 74 72 65 61 6d | 2c 20 53 74 72 65 61 6d |o_stream|, Stream|
|000028a0| 2c 20 53 74 72 69 6e 67 | 2c 20 72 65 61 64 29 2c |, String|, read),|
|000028b0| 0d 09 66 69 6e 64 5f 6e | 61 6d 65 73 5f 73 74 72 |..find_n|ames_str|
|000028c0| 65 61 6d 28 53 74 72 65 | 61 6d 2c 20 5b 5d 2c 20 |eam(Stre|am, [], |
|000028d0| 4e 61 6d 65 4c 69 73 74 | 29 2e 0d 09 0d 66 69 6e |NameList|)....fin|
|000028e0| 64 5f 6e 61 6d 65 73 5f | 73 74 72 65 61 6d 28 53 |d_names_|stream(S|
|000028f0| 74 72 65 61 6d 2c 20 53 | 6f 46 61 72 2c 20 5b 41 |tream, S|oFar, [A|
|00002900| 74 6f 6d 20 7c 20 4e 61 | 6d 65 4c 69 73 74 5d 29 |tom | Na|meList])|
|00002910| 20 3a 2d 0d 09 72 65 5f | 72 61 74 6f 6d 28 53 74 | :-..re_|ratom(St|
|00002920| 72 65 61 6d 2c 20 41 74 | 6f 6d 29 2c 0d 09 73 79 |ream, At|om),..sy|
|00002930| 6d 62 6f 6c 28 41 74 6f | 6d 29 2c 0d 09 63 68 61 |mbol(Ato|m),..cha|
|00002940| 72 28 41 74 6f 6d 2c 20 | 31 2c 20 53 74 61 72 74 |r(Atom, |1, Start|
|00002950| 43 68 61 72 29 2c 0d 09 | 28 53 74 61 72 74 43 68 |Char),..|(StartCh|
|00002960| 61 72 20 3d 20 27 5f 27 | 20 0d 09 3b 53 74 61 72 |ar = '_'| ..;Star|
|00002970| 74 43 68 61 72 20 3e 3d | 20 60 41 60 2c 53 74 61 |tChar >=| `A`,Sta|
|00002980| 72 74 43 68 61 72 20 3d | 3c 20 60 5a 60 0d 09 29 |rtChar =|< `Z`..)|
|00002990| 2c 0d 09 6e 6f 74 28 6d | 65 6d 62 65 72 28 41 74 |,..not(m|ember(At|
|000029a0| 6f 6d 2c 20 53 6f 46 61 | 72 29 29 2c 0d 09 21 2c |om, SoFa|r)),..!,|
|000029b0| 0d 09 66 69 6e 64 5f 6e | 61 6d 65 73 5f 73 74 72 |..find_n|ames_str|
|000029c0| 65 61 6d 28 53 74 72 65 | 61 6d 2c 20 5b 41 74 6f |eam(Stre|am, [Ato|
|000029d0| 6d 20 7c 20 53 6f 46 61 | 72 5d 2c 20 4e 61 6d 65 |m | SoFa|r], Name|
|000029e0| 4c 69 73 74 29 2e 0d 66 | 69 6e 64 5f 6e 61 6d 65 |List)..f|ind_name|
|000029f0| 73 5f 73 74 72 65 61 6d | 28 5f 53 74 72 65 61 6d |s_stream|(_Stream|
|00002a00| 2c 20 5f 53 6f 46 61 72 | 2c 20 5b 5d 29 2e 0d 0d |, _SoFar|, [])...|
|00002a10| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00002a20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002a30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002a40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002a50| 2a 2a 2a 2a 2a 2a 0d 20 | 2a 0d 20 2a 20 4e 6f 77 |******. |*. * Now|
|00002a60| 20 61 20 66 72 6f 6e 74 | 20 65 6e 64 20 74 6f 20 | a front| end to |
|00002a70| 70 72 65 73 65 6e 74 20 | 74 68 69 73 20 64 65 6d |present |this dem|
|00002a80| 6f 6e 73 74 72 61 74 69 | 6f 6e 2e 0d 20 2a 0d 20 |onstrati|on.. *. |
|00002a90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002aa0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ab0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ac0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002ad0| 2a 2a 2a 2a 2a 2f 0d 20 | 0d 70 72 6f 6c 6f 67 5f |*****/. |.prolog_|
|00002ae0| 61 65 5f 64 65 6d 6f 20 | 3a 2d 0d 09 63 72 65 61 |ae_demo |:-..crea|
|00002af0| 74 65 28 62 61 73 69 63 | 5f 77 69 6e 64 6f 77 2c |te(basic|_window,|
|00002b00| 20 41 45 57 69 6e 64 6f | 77 2c 20 0d 09 09 5b 35 | AEWindo|w, ...[5|
|00002b10| 30 2c 20 32 30 2c 20 33 | 34 35 2c 20 35 30 30 5d |0, 20, 3|45, 500]|
|00002b20| 2c 0d 09 09 22 50 72 6f | 6c 6f 67 20 41 70 70 6c |,..."Pro|log Appl|
|00002b30| 65 20 45 76 65 6e 74 20 | 44 65 6d 6f 6e 73 74 72 |e Event |Demonstr|
|00002b40| 61 74 69 6f 6e 22 29 2c | 0d 09 63 72 65 61 74 65 |ation"),|..create|
|00002b50| 28 64 69 73 70 6c 61 79 | 5f 74 65 78 74 2c 20 5f |(display|_text, _|
|00002b60| 2c 20 0d 09 09 5b 35 2c | 20 31 30 2c 20 32 35 2c |, ...[5,| 10, 25,|
|00002b70| 20 34 37 30 5d 2c 20 41 | 45 57 69 6e 64 6f 77 2c | 470], A|EWindow,|
|00002b80| 0d 09 09 22 45 6e 74 65 | 72 20 50 72 6f 6c 6f 67 |..."Ente|r Prolog|
|00002b90| 20 61 73 73 65 72 74 69 | 6f 6e 20 6f 72 20 71 75 | asserti|on or qu|
|00002ba0| 65 72 79 20 28 77 69 74 | 68 6f 75 74 20 74 68 65 |ery (wit|hout the|
|00002bb0| 20 3f 2d 29 20 68 65 72 | 65 3a 22 2c 20 5b 5d 2c | ?-) her|e:", [],|
|00002bc0| 20 73 79 73 74 65 6d 2c | 20 30 2c 20 5f 2c 20 66 | system,| 0, _, f|
|00002bd0| 61 6c 73 65 29 2c 0d 09 | 63 72 65 61 74 65 28 74 |alse),..|create(t|
|00002be0| 65 78 74 5f 65 6e 74 72 | 79 2c 20 47 6f 61 6c 42 |ext_entr|y, GoalB|
|00002bf0| 6f 78 2c 0d 09 09 5b 32 | 35 2c 20 31 30 2c 20 39 |ox,...[2|5, 10, 9|
|00002c00| 35 2c 20 34 37 30 5d 2c | 20 41 45 57 69 6e 64 6f |5, 470],| AEWindo|
|00002c10| 77 2c 0d 09 09 74 72 75 | 65 2c 20 74 72 75 65 2c |w,...tru|e, true,|
|00002c20| 20 74 72 75 65 2c 20 66 | 61 6c 73 65 29 2c 0d 09 | true, f|alse),..|
|00002c30| 73 65 74 5f 66 6f 6e 74 | 28 47 6f 61 6c 42 6f 78 |set_font|(GoalBox|
|00002c40| 2c 20 6d 6f 6e 61 63 6f | 2c 20 39 29 2c 0d 09 63 |, monaco|, 9),..c|
|00002c50| 72 65 61 74 65 28 62 75 | 74 74 6f 6e 2c 20 5f 2c |reate(bu|tton, _,|
|00002c60| 0d 09 09 5b 31 30 30 2c | 20 32 30 2c 20 31 32 30 |...[100,| 20, 120|
|00002c70| 2c 20 31 30 30 5d 2c 20 | 41 45 57 69 6e 64 6f 77 |, 100], |AEWindow|
|00002c80| 2c 0d 09 09 22 41 73 73 | 65 72 74 22 2c 20 0d 09 |,..."Ass|ert", ..|
|00002c90| 09 28 67 65 74 5f 74 65 | 78 74 28 47 6f 61 6c 42 |.(get_te|xt(GoalB|
|00002ca0| 6f 78 2c 20 31 2c 20 30 | 2c 20 2d 31 2c 20 2d 31 |ox, 1, 0|, -1, -1|
|00002cb0| 2c 20 47 6f 61 6c 53 74 | 72 69 6e 67 29 2c 0d 09 |, GoalSt|ring),..|
|00002cc0| 09 20 73 74 72 69 6e 67 | 28 47 6f 61 6c 2c 20 47 |. string|(Goal, G|
|00002cd0| 6f 61 6c 53 74 72 69 6e | 67 29 2c 0d 09 09 20 61 |oalStrin|g),... a|
|00002ce0| 65 41 73 73 65 72 74 28 | 47 6f 61 6c 2c 20 47 6f |eAssert(|Goal, Go|
|00002cf0| 61 6c 53 74 72 69 6e 67 | 29 0d 09 09 29 29 2c 0d |alString|)...)),.|
|00002d00| 09 63 72 65 61 74 65 28 | 62 75 74 74 6f 6e 2c 20 |.create(|button, |
|00002d10| 5f 2c 0d 09 09 5b 31 30 | 30 2c 20 31 32 30 2c 20 |_,...[10|0, 120, |
|00002d20| 31 32 30 2c 20 32 30 30 | 5d 2c 20 41 45 57 69 6e |120, 200|], AEWin|
|00002d30| 64 6f 77 2c 0d 09 09 22 | 51 75 65 72 79 22 2c 20 |dow,..."|Query", |
|00002d40| 0d 09 09 28 67 65 74 5f | 74 65 78 74 28 47 6f 61 |...(get_|text(Goa|
|00002d50| 6c 42 6f 78 2c 20 31 2c | 20 30 2c 20 2d 31 2c 20 |lBox, 1,| 0, -1, |
|00002d60| 2d 31 2c 20 47 6f 61 6c | 53 74 72 69 6e 67 29 2c |-1, Goal|String),|
|00002d70| 0d 09 09 20 61 65 51 75 | 65 72 79 28 47 6f 61 6c |... aeQu|ery(Goal|
|00002d80| 53 74 72 69 6e 67 29 0d | 09 09 29 29 2c 0d 09 63 |String).|..)),..c|
|00002d90| 72 65 61 74 65 28 64 69 | 73 70 6c 61 79 5f 74 65 |reate(di|splay_te|
|00002da0| 78 74 2c 20 5f 2c 20 5b | 31 36 35 2c 20 31 30 2c |xt, _, [|165, 10,|
|00002db0| 20 31 38 35 2c 20 32 33 | 35 5d 2c 20 41 45 57 69 | 185, 23|5], AEWi|
|00002dc0| 6e 64 6f 77 2c 0d 09 09 | 22 53 65 6e 64 69 6e 67 |ndow,...|"Sending|
|00002dd0| 20 41 70 70 6c 65 20 45 | 76 65 6e 74 20 54 72 61 | Apple E|vent Tra|
|00002de0| 63 65 3a 22 2c 20 5b 5d | 2c 20 73 79 73 74 65 6d |ce:", []|, system|
|00002df0| 2c 20 30 2c 20 5f 2c 20 | 66 61 6c 73 65 29 2c 0d |, 0, _, |false),.|
|00002e00| 09 63 72 65 61 74 65 28 | 74 65 78 74 5f 65 6e 74 |.create(|text_ent|
|00002e10| 72 79 2c 20 4c 45 42 2c | 20 0d 09 09 5b 31 38 35 |ry, LEB,| ...[185|
|00002e20| 2c 20 31 30 2c 20 32 39 | 30 2c 20 32 33 35 5d 2c |, 10, 29|0, 235],|
|00002e30| 20 41 45 57 69 6e 64 6f | 77 2c 0d 09 09 74 72 75 | AEWindo|w,...tru|
|00002e40| 65 2c 20 74 72 75 65 2c | 20 74 72 75 65 2c 20 66 |e, true,| true, f|
|00002e50| 61 6c 73 65 29 2c 0d 09 | 63 72 65 61 74 65 28 69 |alse),..|create(i|
|00002e60| 6f 5f 73 74 72 65 61 6d | 2c 20 4c 6f 63 61 6c 4e |o_stream|, LocalN|
|00002e70| 6f 74 69 63 65 53 74 72 | 65 61 6d 2c 20 4c 45 42 |oticeStr|eam, LEB|
|00002e80| 2c 20 61 70 70 65 6e 64 | 29 2c 0d 09 73 65 74 5f |, append|),..set_|
|00002e90| 67 6c 6f 62 61 6c 28 6e | 6f 74 69 63 65 5f 73 74 |global(n|otice_st|
|00002ea0| 72 65 61 6d 2c 20 4c 6f | 63 61 6c 4e 6f 74 69 63 |ream, Lo|calNotic|
|00002eb0| 65 53 74 72 65 61 6d 29 | 2c 0d 09 73 65 74 5f 66 |eStream)|,..set_f|
|00002ec0| 6f 6e 74 28 4c 45 42 2c | 20 6d 6f 6e 61 63 6f 2c |ont(LEB,| monaco,|
|00002ed0| 20 39 29 2c 0d 09 63 72 | 65 61 74 65 28 64 69 73 | 9),..cr|eate(dis|
|00002ee0| 70 6c 61 79 5f 74 65 78 | 74 2c 20 5f 2c 20 5b 31 |play_tex|t, _, [1|
|00002ef0| 36 35 2c 20 32 34 35 2c | 20 31 38 35 2c 20 34 37 |65, 245,| 185, 47|
|00002f00| 30 5d 2c 20 41 45 57 69 | 6e 64 6f 77 2c 0d 09 09 |0], AEWi|ndow,...|
|00002f10| 22 52 65 63 65 69 76 69 | 6e 67 20 41 70 70 6c 65 |"Receivi|ng Apple|
|00002f20| 20 45 76 65 6e 74 20 54 | 72 61 63 65 3a 22 2c 20 | Event T|race:", |
|00002f30| 5b 5d 2c 20 73 79 73 74 | 65 6d 2c 20 30 2c 20 5f |[], syst|em, 0, _|
|00002f40| 2c 20 66 61 6c 73 65 29 | 2c 0d 09 63 72 65 61 74 |, false)|,..creat|
|00002f50| 65 28 74 65 78 74 5f 65 | 6e 74 72 79 2c 20 52 65 |e(text_e|ntry, Re|
|00002f60| 6d 6f 74 65 54 72 61 63 | 65 2c 20 0d 09 09 5b 31 |moteTrac|e, ...[1|
|00002f70| 38 35 2c 20 32 34 35 2c | 20 32 39 30 2c 20 34 37 |85, 245,| 290, 47|
|00002f80| 30 5d 2c 20 41 45 57 69 | 6e 64 6f 77 2c 0d 09 09 |0], AEWi|ndow,...|
|00002f90| 74 72 75 65 2c 20 74 72 | 75 65 2c 20 74 72 75 65 |true, tr|ue, true|
|00002fa0| 2c 20 66 61 6c 73 65 29 | 2c 0d 09 73 65 74 5f 66 |, false)|,..set_f|
|00002fb0| 6f 6e 74 28 52 65 6d 6f | 74 65 54 72 61 63 65 2c |ont(Remo|teTrace,|
|00002fc0| 20 6d 6f 6e 61 63 6f 2c | 20 39 29 2c 0d 09 63 72 | monaco,| 9),..cr|
|00002fd0| 65 61 74 65 28 69 6f 5f | 73 74 72 65 61 6d 2c 20 |eate(io_|stream, |
|00002fe0| 52 65 6d 6f 74 65 4e 6f | 74 69 63 65 53 74 72 65 |RemoteNo|ticeStre|
|00002ff0| 61 6d 2c 20 52 65 6d 6f | 74 65 54 72 61 63 65 2c |am, Remo|teTrace,|
|00003000| 20 61 70 70 65 6e 64 29 | 2c 0d 09 73 65 74 5f 67 | append)|,..set_g|
|00003010| 6c 6f 62 61 6c 28 72 65 | 6d 6f 74 65 5f 6e 6f 74 |lobal(re|mote_not|
|00003020| 69 63 65 5f 73 74 72 65 | 61 6d 2c 20 52 65 6d 6f |ice_stre|am, Remo|
|00003030| 74 65 4e 6f 74 69 63 65 | 53 74 72 65 61 6d 29 2c |teNotice|Stream),|
|00003040| 0d 09 2f 2a 0d 09 20 2a | 20 41 20 73 65 74 20 6f |../*.. *| A set o|
|00003050| 66 20 63 68 65 63 6b 20 | 62 6f 78 65 73 20 74 6f |f check |boxes to|
|00003060| 20 73 65 6c 65 63 74 20 | 77 68 65 72 65 20 74 6f | select |where to|
|00003070| 20 73 65 6e 64 20 74 68 | 69 73 20 70 72 6f 63 65 | send th|is proce|
|00003080| 73 73 2e 0d 09 20 2a 2f | 0d 09 63 72 65 61 74 65 |ss... */|..create|
|00003090| 28 73 65 6c 65 63 74 5f | 6f 6e 65 2c 20 5f 2c 20 |(select_|one, _, |
|000030a0| 5b 31 32 35 2c 20 32 30 | 2c 20 31 36 35 2c 20 32 |[125, 20|, 165, 2|
|000030b0| 30 30 5d 2c 20 41 45 57 | 69 6e 64 6f 77 2c 0d 09 |00], AEW|indow,..|
|000030c0| 09 5b 5b 22 54 68 69 73 | 20 50 72 6f 6c 6f 67 22 |.[["This| Prolog"|
|000030d0| 2c 20 74 68 69 73 5f 70 | 72 6f 6c 6f 67 5d 2c 0d |, this_p|rolog],.|
|000030e0| 09 09 20 5b 22 52 65 6d | 6f 74 65 20 50 72 6f 6c |.. ["Rem|ote Prol|
|000030f0| 6f 67 2e 2e 2e 22 2c 20 | 72 65 6d 6f 74 65 5f 70 |og...", |remote_p|
|00003100| 72 6f 6c 6f 67 5d 5d 2c | 0d 09 09 74 68 69 73 5f |rolog]],|...this_|
|00003110| 70 72 6f 6c 6f 67 2c 0d | 09 09 73 65 74 5f 70 72 |prolog,.|..set_pr|
|00003120| 6f 6c 6f 67 5f 72 65 63 | 65 69 76 65 72 28 74 68 |olog_rec|eiver(th|
|00003130| 69 73 5f 6f 62 6a 65 63 | 74 2c 20 76 61 6c 75 65 |is_objec|t, value|
|00003140| 29 29 2c 0d 09 67 65 74 | 5f 67 6c 6f 62 61 6c 28 |)),..get|_global(|
|00003150| 74 68 69 73 5f 66 69 6c | 65 2c 20 54 68 69 73 46 |this_fil|e, ThisF|
|00003160| 69 6c 65 29 2c 0d 09 63 | 72 65 61 74 65 28 69 63 |ile),..c|reate(ic|
|00003170| 6f 6e 2c 20 5f 2c 20 5b | 31 33 30 2c 20 32 32 34 |on, _, [|130, 224|
|00003180| 2c 20 31 36 32 2c 20 32 | 35 36 5d 2c 20 41 45 57 |, 162, 2|56], AEW|
|00003190| 69 6e 64 6f 77 2c 0d 09 | 09 5b 54 68 69 73 46 69 |indow,..|.[ThisFi|
|000031a0| 6c 65 2c 20 31 32 38 5d | 2c 20 64 69 73 70 6c 61 |le, 128]|, displa|
|000031b0| 79 5f 68 65 6c 70 28 41 | 45 57 69 6e 64 6f 77 29 |y_help(A|EWindow)|
|000031c0| 29 2c 0d 09 63 72 65 61 | 74 65 28 73 65 6c 65 63 |),..crea|te(selec|
|000031d0| 74 5f 6f 6e 65 2c 20 5f | 2c 20 5b 31 30 30 2c 20 |t_one, _|, [100, |
|000031e0| 32 38 35 2c 20 31 36 32 | 2c 20 34 37 30 5d 2c 20 |285, 162|, 470], |
|000031f0| 41 45 57 69 6e 64 6f 77 | 2c 0d 09 09 5b 5b 22 51 |AEWindow|,...[["Q|
|00003200| 75 65 75 65 20 52 65 70 | 6c 79 22 2c 20 71 75 65 |ueue Rep|ly", que|
|00003210| 75 65 5f 72 65 70 6c 79 | 5d 2c 0d 09 09 20 5b 22 |ue_reply|],... ["|
|00003220| 57 61 69 74 20 46 6f 72 | 20 52 65 70 6c 79 22 2c |Wait For| Reply",|
|00003230| 20 77 61 69 74 5f 72 65 | 70 6c 79 5d 2c 0d 09 09 | wait_re|ply],...|
|00003240| 20 5b 22 4e 6f 20 52 65 | 70 6c 79 22 2c 20 6e 6f | ["No Re|ply", no|
|00003250| 5f 72 65 70 6c 79 5d 5d | 2c 0d 09 09 71 75 65 75 |_reply]]|,...queu|
|00003260| 65 5f 72 65 70 6c 79 2c | 0d 09 09 73 65 74 5f 72 |e_reply,|...set_r|
|00003270| 65 70 6c 79 5f 6d 6f 64 | 65 28 76 61 6c 75 65 29 |eply_mod|e(value)|
|00003280| 29 2e 0d 0d 73 65 74 5f | 70 72 6f 6c 6f 67 5f 72 |)...set_|prolog_r|
|00003290| 65 63 65 69 76 65 72 28 | 5f 53 65 6c 65 63 74 4f |eceiver(|_SelectO|
|000032a0| 6e 65 2c 20 74 68 69 73 | 5f 70 72 6f 6c 6f 67 29 |ne, this|_prolog)|
|000032b0| 20 3a 2d 0d 09 73 65 74 | 5f 67 6c 6f 62 61 6c 28 | :-..set|_global(|
|000032c0| 70 72 6f 6c 6f 67 5f 74 | 61 6c 6b 69 6e 67 5f 77 |prolog_t|alking_w|
|000032d0| 69 74 68 2c 20 22 41 49 | 46 43 22 29 2c 21 2e 0d |ith, "AI|FC"),!..|
|000032e0| 73 65 74 5f 70 72 6f 6c | 6f 67 5f 72 65 63 65 69 |set_prol|og_recei|
|000032f0| 76 65 72 28 5f 53 65 6c | 65 63 74 4f 6e 65 2c 20 |ver(_Sel|ectOne, |
|00003300| 72 65 6d 6f 74 65 5f 70 | 72 6f 6c 6f 67 29 20 3a |remote_p|rolog) :|
|00003310| 2d 0d 09 61 73 6b 5f 66 | 6f 72 5f 70 72 6f 63 65 |-..ask_f|or_proce|
|00003320| 73 73 28 50 72 6f 63 65 | 73 73 29 2c 0d 09 73 65 |ss(Proce|ss),..se|
|00003330| 74 5f 67 6c 6f 62 61 6c | 28 70 72 6f 6c 6f 67 5f |t_global|(prolog_|
|00003340| 74 61 6c 6b 69 6e 67 5f | 77 69 74 68 2c 20 50 72 |talking_|with, Pr|
|00003350| 6f 63 65 73 73 29 2c 0d | 09 21 2e 0d 73 65 74 5f |ocess),.|.!..set_|
|00003360| 70 72 6f 6c 6f 67 5f 72 | 65 63 65 69 76 65 72 28 |prolog_r|eceiver(|
|00003370| 53 65 6c 65 63 74 4f 6e | 65 2c 20 5f 29 20 3a 2d |SelectOn|e, _) :-|
|00003380| 20 0d 09 73 79 73 62 65 | 65 70 28 31 30 29 2c 0d | ..sysbe|ep(10),.|
|00003390| 09 73 65 74 5f 76 61 6c | 75 65 28 53 65 6c 65 63 |.set_val|ue(Selec|
|000033a0| 74 4f 6e 65 2c 20 74 68 | 69 73 5f 70 72 6f 6c 6f |tOne, th|is_prolo|
|000033b0| 67 29 2e 0d 09 0d 73 65 | 74 5f 72 65 70 6c 79 5f |g)....se|t_reply_|
|000033c0| 6d 6f 64 65 28 52 65 70 | 6c 79 4d 6f 64 65 29 20 |mode(Rep|lyMode) |
|000033d0| 3a 2d 0d 09 73 65 74 5f | 67 6c 6f 62 61 6c 28 72 |:-..set_|global(r|
|000033e0| 65 70 6c 79 5f 6d 6f 64 | 65 2c 20 52 65 70 6c 79 |eply_mod|e, Reply|
|000033f0| 4d 6f 64 65 29 2e 0d 0d | 2f 2a 0d 20 2a 20 46 75 |Mode)...|/*. * Fu|
|00003400| 6e 63 74 69 6f 6e 20 74 | 68 61 74 20 64 69 73 70 |nction t|hat disp|
|00003410| 6c 61 79 73 20 73 6f 6d | 65 20 73 69 6d 70 6c 65 |lays som|e simple|
|00003420| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 77 68 65 | informa|tion whe|
|00003430| 6e 20 74 68 65 20 75 73 | 65 72 0d 20 2a 20 61 73 |n the us|er. * as|
|00003440| 6b 73 20 66 6f 72 20 69 | 74 2e 0d 20 2a 2f 0d 64 |ks for i|t.. */.d|
|00003450| 69 73 70 6c 61 79 5f 68 | 65 6c 70 28 57 69 6e 64 |isplay_h|elp(Wind|
|00003460| 6f 77 29 20 3a 2d 0d 09 | 63 75 72 72 65 6e 74 5f |ow) :-..|current_|
|00003470| 73 69 7a 65 28 57 69 6e | 64 6f 77 2c 20 57 4c 6f |size(Win|dow, WLo|
|00003480| 63 29 2c 0d 09 4c 6f 63 | 20 69 73 20 28 57 4c 6f |c),..Loc| is (WLo|
|00003490| 63 20 2d 20 5b 57 4c 6f | 63 5e 2e 74 6f 70 2c 20 |c - [WLo|c^.top, |
|000034a0| 57 4c 6f 63 5e 2e 6c 65 | 66 74 5d 29 20 3c 3c 20 |WLoc^.le|ft]) << |
|000034b0| 5b 35 2c 20 32 30 5d 2c | 0d 09 63 72 65 61 74 65 |[5, 20],|..create|
|000034c0| 28 70 69 63 74 75 72 65 | 5f 64 72 61 77 69 6e 67 |(picture|_drawing|
|000034d0| 5f 6f 62 6a 65 63 74 2c | 20 42 47 2c 20 4c 6f 63 |_object,| BG, Loc|
|000034e0| 2c 20 57 69 6e 64 6f 77 | 2c 0d 09 09 5b 30 2c 20 |, Window|,...[0, |
|000034f0| 30 5d 2c 0d 09 09 5b 2d | 33 32 37 36 38 2c 20 2d |0],...[-|32768, -|
|00003500| 33 32 37 36 38 2c 20 33 | 32 37 36 37 2c 20 33 32 |32768, 3|2767, 32|
|00003510| 37 36 37 5d 2c 0d 09 09 | 74 72 75 65 29 2c 20 2f |767],...|true), /|
|00003520| 2a 20 42 6c 61 6e 6b 20 | 42 61 63 6b 67 72 6f 75 |* Blank |Backgrou|
|00003530| 6e 64 20 2a 2f 0d 09 6c | 6f 63 61 6c 5f 63 61 6c |nd */..l|ocal_cal|
|00003540| 6c 28 42 47 2c 20 70 61 | 69 6e 74 28 5b 2d 33 32 |l(BG, pa|int([-32|
|00003550| 37 36 37 2c 20 2d 33 32 | 37 36 37 2c 20 33 32 37 |767, -32|767, 327|
|00003560| 36 37 2c 20 33 32 37 36 | 37 5d 2c 20 6c 69 67 68 |67, 3276|7], ligh|
|00003570| 74 5f 67 72 61 79 29 29 | 2c 0d 09 6e 65 65 64 73 |t_gray))|,..needs|
|00003580| 5f 6e 6f 5f 72 65 64 72 | 61 77 69 6e 67 28 42 47 |_no_redr|awing(BG|
|00003590| 2c 20 5b 2d 33 32 37 36 | 37 2c 20 2d 33 32 37 36 |, [-3276|7, -3276|
|000035a0| 37 2c 20 33 32 37 36 37 | 2c 20 33 32 37 36 37 5d |7, 32767|, 32767]|
|000035b0| 29 2c 0d 09 63 72 65 61 | 74 65 28 64 69 73 70 6c |),..crea|te(displ|
|000035c0| 61 79 5f 74 65 78 74 2c | 20 54 65 6d 70 4d 65 73 |ay_text,| TempMes|
|000035d0| 73 61 67 65 2c 20 4c 6f | 63 3c 3c 32 30 2c 20 57 |sage, Lo|c<<20, W|
|000035e0| 69 6e 64 6f 77 2c 0d 27 | 55 73 69 6e 67 20 74 68 |indow,.'|Using th|
|000035f0| 69 73 20 44 65 6d 6f 3a | 0d 0d 54 68 69 73 20 64 |is Demo:|..This d|
|00003600| 65 6d 6f 20 69 6c 6c 75 | 73 74 72 61 74 65 73 20 |emo illu|strates |
|00003610| 73 65 6e 64 69 6e 67 20 | 61 73 73 65 72 74 69 6f |sending |assertio|
|00003620| 6e 73 20 61 6e 64 20 71 | 75 65 72 69 65 73 20 74 |ns and q|ueries t|
|00003630| 6f 20 61 6e 64 20 66 72 | 6f 6d 20 50 72 6f 6c 6f |o and fr|om Prolo|
|00003640| 67 2e 0d 0d 45 6e 74 65 | 72 20 61 20 50 72 6f 6c |g...Ente|r a Prol|
|00003650| 6f 67 20 47 6f 61 6c 20 | 69 6e 20 74 68 65 20 74 |og Goal |in the t|
|00003660| 6f 70 20 74 65 78 74 20 | 65 6e 74 72 79 20 66 69 |op text |entry fi|
|00003670| 65 6c 64 2e 20 20 0d 54 | 68 65 6e 20 79 6f 75 20 |eld. .T|hen you |
|00003680| 63 61 6e 20 65 69 74 68 | 65 72 20 61 73 73 65 72 |can eith|er asser|
|00003690| 74 20 6f 72 20 71 75 65 | 72 79 20 74 68 69 73 20 |t or que|ry this |
|000036a0| 67 6f 61 6c 20 74 6f 20 | 74 68 65 20 6f 74 68 65 |goal to |the othe|
|000036b0| 72 20 50 72 6f 6c 6f 67 | 20 70 72 6f 63 65 73 73 |r Prolog| process|
|000036c0| 2e 20 20 0d 55 73 65 20 | 73 74 61 6e 64 61 72 64 |. .Use |standard|
|000036d0| 20 50 72 6f 6c 6f 67 20 | 73 79 6e 74 61 78 3b 20 | Prolog |syntax; |
|000036e0| 62 75 74 20 64 6f 20 6e | 6f 74 20 69 6e 63 6c 75 |but do n|ot inclu|
|000036f0| 64 65 20 74 68 65 20 3f | 2d 20 66 6f 72 20 71 75 |de the ?|- for qu|
|00003700| 65 72 69 65 73 2e 20 20 | 0d 54 68 75 73 2c 20 61 |eries. |.Thus, a|
|00003710| 66 74 65 72 20 79 6f 75 | 20 6d 61 6b 65 20 61 6e |fter you| make an|
|00003720| 79 20 61 73 73 65 72 74 | 69 6f 6e 2c 20 79 6f 75 |y assert|ion, you|
|00003730| 20 63 61 6e 20 73 65 6e | 64 20 74 68 61 74 20 67 | can sen|d that g|
|00003740| 6f 61 6c 20 61 73 20 61 | 20 71 75 65 72 79 2e 0d |oal as a| query..|
|00003750| 0d 53 65 6e 64 69 6e 67 | 20 69 73 20 74 72 61 63 |.Sending| is trac|
|00003760| 65 64 20 6f 6e 20 74 68 | 65 20 62 6f 74 74 6f 6d |ed on th|e bottom|
|00003770| 20 6c 65 66 74 2e 20 20 | 0d 52 65 63 65 69 76 69 | left. |.Receivi|
|00003780| 6e 67 20 6f 66 20 61 70 | 70 6c 65 20 65 76 65 6e |ng of ap|ple even|
|00003790| 74 73 20 73 65 6e 74 20 | 62 61 63 6b 20 74 6f 20 |ts sent |back to |
|000037a0| 74 68 69 73 20 70 72 6f | 63 65 73 73 20 69 73 20 |this pro|cess is |
|000037b0| 6f 6e 20 74 68 65 20 62 | 6f 74 74 6f 6d 20 72 69 |on the b|ottom ri|
|000037c0| 67 68 74 2e 20 20 0d 46 | 69 6e 61 6c 6c 79 2c 20 |ght. .F|inally, |
|000037d0| 74 68 65 20 72 65 70 6c | 79 20 72 65 63 65 69 76 |the repl|y receiv|
|000037e0| 65 64 20 69 73 20 74 72 | 61 63 65 64 20 61 67 61 |ed is tr|aced aga|
|000037f0| 69 6e 20 6f 6e 20 74 68 | 65 20 62 6f 74 74 6f 6d |in on th|e bottom|
|00003800| 20 6c 65 66 74 2e 0d 0d | 54 72 79 20 74 6f 20 61 | left...|Try to a|
|00003810| 73 73 65 72 74 20 28 65 | 6e 74 65 72 20 69 6e 20 |ssert (e|nter in |
|00003820| 74 6f 70 20 66 69 65 6c | 64 29 3a 20 20 20 20 20 |top fiel|d): |
|00003830| 20 20 6d 61 6e 28 6a 6f | 68 6e 29 0d 54 68 65 6e | man(jo|hn).Then|
|00003840| 20 74 72 79 20 74 6f 20 | 71 75 65 72 79 20 28 65 | try to |query (e|
|00003850| 6e 74 65 72 20 69 6e 20 | 74 6f 70 20 66 69 65 6c |nter in |top fiel|
|00003860| 64 29 3a 20 20 20 20 20 | 20 6d 61 6e 28 57 68 6f |d): | man(Who|
|00003870| 29 0d 27 2c 0d 0d 09 09 | 5b 5d 2c 0d 09 09 74 69 |).',....|[],...ti|
|00003880| 6d 65 73 2c 20 31 32 2c | 20 5f 2c 20 66 61 6c 73 |mes, 12,| _, fals|
|00003890| 65 29 2c 0d 09 63 72 65 | 61 74 65 28 62 75 74 74 |e),..cre|ate(butt|
|000038a0| 6f 6e 2c 20 4f 4b 5f 42 | 75 74 74 6f 6e 2c 20 5b |on, OK_B|utton, [|
|000038b0| 4c 6f 63 5e 2e 62 6f 74 | 74 6f 6d 2d 33 30 2c 20 |Loc^.bot|tom-30, |
|000038c0| 4c 6f 63 5e 2e 72 69 67 | 68 74 2d 31 32 30 2c 0d |Loc^.rig|ht-120,.|
|000038d0| 09 09 09 4c 6f 63 5e 2e | 62 6f 74 74 6f 6d 20 2d |...Loc^.|bottom -|
|000038e0| 20 31 30 2c 20 4c 6f 63 | 5e 2e 72 69 67 68 74 20 | 10, Loc|^.right |
|000038f0| 2d 20 34 30 5d 2c 0d 09 | 09 09 57 69 6e 64 6f 77 |- 40],..|..Window|
|00003900| 2c 20 22 43 6f 6e 74 69 | 6e 75 65 c9 22 2c 20 0d |, "Conti|nue.", .|
|00003910| 09 09 28 64 65 73 74 72 | 6f 79 28 74 68 69 73 5f |..(destr|oy(this_|
|00003920| 6f 62 6a 65 63 74 29 2c | 20 64 65 73 74 72 6f 79 |object),| destroy|
|00003930| 28 54 65 6d 70 4d 65 73 | 73 61 67 65 29 2c 0d 09 |(TempMes|sage),..|
|00003940| 09 20 64 65 73 74 72 6f | 79 28 42 47 29 2c 20 64 |. destro|y(BG), d|
|00003950| 69 73 70 6c 61 79 5f 68 | 65 6c 70 32 28 57 69 6e |isplay_h|elp2(Win|
|00003960| 64 6f 77 29 29 29 2c 0d | 09 73 65 74 5f 64 65 66 |dow))),.|.set_def|
|00003970| 61 75 6c 74 5f 6f 62 6a | 65 63 74 28 4f 4b 5f 42 |ault_obj|ect(OK_B|
|00003980| 75 74 74 6f 6e 2c 20 73 | 65 74 5f 76 61 6c 75 65 |utton, s|et_value|
|00003990| 28 4f 4b 5f 42 75 74 74 | 6f 6e 2c 20 74 72 75 65 |(OK_Butt|on, true|
|000039a0| 29 29 2c 0d 09 2f 2a 0d | 09 20 2a 20 57 61 69 74 |)),../*.|. * Wait|
|000039b0| 20 74 69 6c 6c 20 75 73 | 65 72 20 64 65 73 74 72 | till us|er destr|
|000039c0| 6f 79 73 20 74 68 65 20 | 62 75 74 74 6f 6e 2e 0d |oys the |button..|
|000039d0| 09 20 2a 2f 0d 09 73 69 | 6d 70 6c 65 5f 65 76 65 |. */..si|mple_eve|
|000039e0| 6e 74 5f 6c 6f 6f 70 28 | 54 65 6d 70 4d 65 73 73 |nt_loop(|TempMess|
|000039f0| 61 67 65 29 2e 0d 0d 64 | 69 73 70 6c 61 79 5f 68 |age)...d|isplay_h|
|00003a00| 65 6c 70 32 28 57 69 6e | 64 6f 77 29 20 3a 2d 0d |elp2(Win|dow) :-.|
|00003a10| 09 63 75 72 72 65 6e 74 | 5f 73 69 7a 65 28 57 69 |.current|_size(Wi|
|00003a20| 6e 64 6f 77 2c 20 57 4c | 6f 63 29 2c 0d 09 4c 6f |ndow, WL|oc),..Lo|
|00003a30| 63 20 69 73 20 28 57 4c | 6f 63 20 2d 20 5b 57 4c |c is (WL|oc - [WL|
|00003a40| 6f 63 5e 2e 74 6f 70 2c | 20 57 4c 6f 63 5e 2e 6c |oc^.top,| WLoc^.l|
|00003a50| 65 66 74 5d 29 20 3c 3c | 20 5b 35 2c 20 32 30 5d |eft]) <<| [5, 20]|
|00003a60| 2c 0d 09 63 72 65 61 74 | 65 28 70 69 63 74 75 72 |,..creat|e(pictur|
|00003a70| 65 5f 64 72 61 77 69 6e | 67 5f 6f 62 6a 65 63 74 |e_drawin|g_object|
|00003a80| 2c 20 42 47 2c 20 4c 6f | 63 2c 20 57 69 6e 64 6f |, BG, Lo|c, Windo|
|00003a90| 77 2c 0d 09 09 5b 30 2c | 20 30 5d 2c 0d 09 09 5b |w,...[0,| 0],...[|
|00003aa0| 2d 33 32 37 36 38 2c 20 | 2d 33 32 37 36 38 2c 20 |-32768, |-32768, |
|00003ab0| 33 32 37 36 37 2c 20 33 | 32 37 36 37 5d 2c 0d 09 |32767, 3|2767],..|
|00003ac0| 09 74 72 75 65 29 2c 20 | 2f 2a 20 42 6c 61 6e 6b |.true), |/* Blank|
|00003ad0| 20 42 61 63 6b 67 72 6f | 75 6e 64 20 2a 2f 0d 09 | Backgro|und */..|
|00003ae0| 6c 6f 63 61 6c 5f 63 61 | 6c 6c 28 42 47 2c 20 70 |local_ca|ll(BG, p|
|00003af0| 61 69 6e 74 28 5b 2d 33 | 32 37 36 37 2c 20 2d 33 |aint([-3|2767, -3|
|00003b00| 32 37 36 37 2c 20 33 32 | 37 36 37 2c 20 33 32 37 |2767, 32|767, 327|
|00003b10| 36 37 5d 2c 20 6c 69 67 | 68 74 5f 67 72 61 79 29 |67], lig|ht_gray)|
|00003b20| 29 2c 0d 09 6e 65 65 64 | 73 5f 6e 6f 5f 72 65 64 |),..need|s_no_red|
|00003b30| 72 61 77 69 6e 67 28 42 | 47 2c 20 5b 2d 33 32 37 |rawing(B|G, [-327|
|00003b40| 36 37 2c 20 2d 33 32 37 | 36 37 2c 20 33 32 37 36 |67, -327|67, 3276|
|00003b50| 37 2c 20 33 32 37 36 37 | 5d 29 2c 0d 09 63 72 65 |7, 32767|]),..cre|
|00003b60| 61 74 65 28 64 69 73 70 | 6c 61 79 5f 74 65 78 74 |ate(disp|lay_text|
|00003b70| 2c 20 54 65 6d 70 4d 65 | 73 73 61 67 65 2c 20 4c |, TempMe|ssage, L|
|00003b80| 6f 63 3c 3c 31 30 2c 20 | 57 69 6e 64 6f 77 2c 0d |oc<<10, |Window,.|
|00003b90| 27 49 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 61 62 6f |'Informa|tion abo|
|00003ba0| 75 74 20 54 61 6c 6b 69 | 6e 67 20 77 69 74 68 20 |ut Talki|ng with |
|00003bb0| 52 65 6d 6f 74 65 20 50 | 72 6f 6c 6f 67 73 2e 0d |Remote P|rologs..|
|00003bc0| 0d 54 68 69 73 20 64 65 | 6d 6f 6e 73 74 72 61 74 |.This de|monstrat|
|00003bd0| 69 6f 6e 20 63 61 6e 20 | 73 65 6e 64 20 61 70 70 |ion can |send app|
|00003be0| 6c 65 20 65 76 65 6e 74 | 73 20 74 6f 20 69 74 73 |le event|s to its|
|00003bf0| 65 6c 66 20 6f 72 20 61 | 6e 6f 74 68 65 72 20 0d |elf or a|nother .|
|00003c00| 63 6f 70 79 20 6f 66 20 | 41 41 49 53 20 46 75 6c |copy of |AAIS Ful|
|00003c10| 6c 20 43 6f 6e 74 72 6f | 6c 20 50 72 6f 6c 6f 67 |l Contro|l Prolog|
|00003c20| 20 6f 6e 20 79 6f 75 72 | 20 6c 6f 63 61 6c 20 61 | on your| local a|
|00003c30| 70 70 6c 65 74 61 6c 6b | 20 6e 65 74 77 6f 72 6b |ppletalk| network|
|00003c40| 2e 20 20 20 0d 54 68 65 | 20 6f 74 68 65 72 20 63 |. .The| other c|
|00003c50| 6f 70 79 20 6d 75 73 74 | 20 62 65 20 61 6c 72 65 |opy must| be alre|
|00003c60| 61 64 79 20 72 75 6e 6e | 69 6e 67 2c 20 61 6e 64 |ady runn|ing, and|
|00003c70| 20 69 74 20 6d 75 73 74 | 20 68 61 76 65 20 68 61 | it must| have ha|
|00003c80| 64 20 74 68 69 73 20 0d | 22 54 61 6c 6b 20 77 69 |d this .|"Talk wi|
|00003c90| 74 68 20 50 72 6f 6c 6f | 67 2e 70 22 20 66 69 6c |th Prolo|g.p" fil|
|00003ca0| 65 20 61 6c 72 65 61 64 | 79 20 63 6f 6e 73 75 6c |e alread|y consul|
|00003cb0| 74 65 64 20 28 6f 72 20 | 79 6f 75 20 63 61 6e 20 |ted (or |you can |
|00003cc0| 73 65 6e 64 20 61 6e 20 | 60 6f 64 6f 63 60 0d 65 |send an |`odoc`.e|
|00003cd0| 76 65 6e 74 20 74 6f 20 | 63 6f 6e 73 75 6c 74 20 |vent to |consult |
|00003ce0| 74 68 69 73 20 2d 2d 20 | 73 65 65 20 74 68 65 20 |this -- |see the |
|00003cf0| 66 69 6c 65 20 22 41 70 | 70 6c 65 20 45 76 65 6e |file "Ap|ple Even|
|00003d00| 74 20 4e 6f 74 65 73 22 | 20 66 6f 72 20 64 65 74 |t Notes"| for det|
|00003d10| 61 69 6c 73 29 2e 0d 0d | 54 68 65 20 72 65 6d 6f |ails)...|The remo|
|00003d20| 74 65 20 6d 61 63 68 69 | 6e 65 20 6d 75 73 74 20 |te machi|ne must |
|00003d30| 61 6c 6c 6f 77 20 66 69 | 6c 65 20 73 68 61 72 69 |allow fi|le shari|
|00003d40| 6e 67 20 61 6e 64 20 70 | 72 6f 67 72 61 6d 20 6c |ng and p|rogram l|
|00003d50| 69 6e 6b 69 6e 67 2e 20 | 20 0d 54 68 69 73 20 69 |inking. | .This i|
|00003d60| 73 20 73 65 74 20 69 6e | 20 74 68 65 20 22 53 68 |s set in| the "Sh|
|00003d70| 61 72 69 6e 67 20 53 65 | 74 75 70 22 20 63 6f 6e |aring Se|tup" con|
|00003d80| 74 72 6f 6c 20 77 68 69 | 63 68 20 69 73 20 61 63 |trol whi|ch is ac|
|00003d90| 63 65 73 73 65 64 20 0d | 69 6e 73 69 64 65 20 74 |cessed .|inside t|
|00003da0| 68 65 20 43 6f 6e 74 72 | 6f 6c 20 50 61 6e 65 6c |he Contr|ol Panel|
|00003db0| 73 20 66 6f 6c 64 65 72 | 20 66 72 6f 6d 20 74 68 |s folder| from th|
|00003dc0| 65 20 41 70 70 6c 65 20 | 4d 65 6e 75 2e 20 20 59 |e Apple |Menu. Y|
|00003dd0| 6f 75 20 77 69 6c 6c 0d | 62 65 20 61 73 6b 65 64 |ou will.|be asked|
|00003de0| 20 74 6f 20 6c 6f 67 20 | 69 6e 20 6f 6e 20 74 68 | to log |in on th|
|00003df0| 65 20 72 65 6d 6f 74 65 | 20 6d 61 63 68 69 6e 65 |e remote| machine|
|00003e00| 20 77 68 65 6e 20 79 6f | 75 20 73 65 6e 64 20 74 | when yo|u send t|
|00003e10| 68 65 20 0d 66 69 72 73 | 74 20 61 70 70 6c 65 20 |he .firs|t apple |
|00003e20| 65 76 65 6e 74 20 6f 76 | 65 72 2e 20 20 0d 0d 46 |event ov|er. ..F|
|00003e30| 69 6e 61 6c 6c 79 2c 20 | 79 6f 75 20 77 69 6c 6c |inally, |you will|
|00003e40| 20 6e 65 65 64 20 74 77 | 6f 20 64 69 73 74 69 6e | need tw|o distin|
|00003e50| 63 74 20 50 72 6f 6c 6f | 67 20 72 65 67 69 73 74 |ct Prolo|g regist|
|00003e60| 72 61 74 69 6f 6e 20 0d | 6e 75 6d 62 65 72 73 2f |ration .|numbers/|
|00003e70| 63 6f 70 69 65 73 20 69 | 6e 20 6f 72 64 65 72 20 |copies i|n order |
|00003e80| 74 6f 20 72 75 6e 20 74 | 68 69 73 20 64 65 6d 6f |to run t|his demo|
|00003e90| 6e 73 74 72 61 74 69 6f | 6e 20 6f 6e 20 74 77 6f |nstratio|n on two|
|00003ea0| 20 6d 61 63 68 69 6e 65 | 0d 61 74 20 74 68 65 20 | machine|.at the |
|00003eb0| 73 61 6d 65 20 74 69 6d | 65 2e 20 20 59 6f 75 20 |same tim|e. You |
|00003ec0| 6f 6e 6c 79 20 6e 65 65 | 64 20 6f 6e 65 20 72 65 |only nee|d one re|
|00003ed0| 67 69 73 74 72 61 74 69 | 6f 6e 20 6e 75 6d 62 65 |gistrati|on numbe|
|00003ee0| 72 20 74 6f 20 73 65 6e | 64 0d 61 70 70 6c 65 20 |r to sen|d.apple |
|00003ef0| 65 76 65 6e 74 73 20 62 | 61 63 6b 20 74 6f 20 74 |events b|ack to t|
|00003f00| 68 69 73 20 50 72 6f 6c | 6f 67 20 73 65 73 73 69 |his Prol|og sessi|
|00003f10| 6f 6e 2e 27 2c 0d 0d 09 | 09 5b 5d 2c 0d 09 09 74 |on.',...|.[],...t|
|00003f20| 69 6d 65 73 2c 20 31 32 | 2c 20 5f 2c 20 66 61 6c |imes, 12|, _, fal|
|00003f30| 73 65 29 2c 0d 09 63 72 | 65 61 74 65 28 62 75 74 |se),..cr|eate(but|
|00003f40| 74 6f 6e 2c 20 4f 4b 5f | 42 75 74 74 6f 6e 2c 20 |ton, OK_|Button, |
|00003f50| 5b 4c 6f 63 5e 2e 62 6f | 74 74 6f 6d 2d 33 30 2c |[Loc^.bo|ttom-30,|
|00003f60| 20 4c 6f 63 5e 2e 72 69 | 67 68 74 2d 31 32 30 2c | Loc^.ri|ght-120,|
|00003f70| 0d 09 09 09 4c 6f 63 5e | 2e 62 6f 74 74 6f 6d 20 |....Loc^|.bottom |
|00003f80| 2d 20 31 30 2c 20 4c 6f | 63 5e 2e 72 69 67 68 74 |- 10, Lo|c^.right|
|00003f90| 20 2d 20 34 30 5d 2c 0d | 09 09 09 57 69 6e 64 6f | - 40],.|...Windo|
|00003fa0| 77 2c 20 22 4f 4b 22 2c | 20 0d 09 09 28 64 65 73 |w, "OK",| ...(des|
|00003fb0| 74 72 6f 79 28 74 68 69 | 73 5f 6f 62 6a 65 63 74 |troy(thi|s_object|
|00003fc0| 29 2c 20 64 65 73 74 72 | 6f 79 28 54 65 6d 70 4d |), destr|oy(TempM|
|00003fd0| 65 73 73 61 67 65 29 2c | 0d 09 09 20 64 65 73 74 |essage),|... dest|
|00003fe0| 72 6f 79 28 42 47 29 29 | 29 2c 0d 09 73 65 74 5f |roy(BG))|),..set_|
|00003ff0| 64 65 66 61 75 6c 74 5f | 6f 62 6a 65 63 74 28 4f |default_|object(O|
|00004000| 4b 5f 42 75 74 74 6f 6e | 2c 20 73 65 74 5f 76 61 |K_Button|, set_va|
|00004010| 6c 75 65 28 4f 4b 5f 42 | 75 74 74 6f 6e 2c 20 74 |lue(OK_B|utton, t|
|00004020| 72 75 65 29 29 2c 0d 09 | 2f 2a 0d 09 20 2a 20 57 |rue)),..|/*.. * W|
|00004030| 61 69 74 20 74 69 6c 6c | 20 75 73 65 72 20 64 65 |ait till| user de|
|00004040| 73 74 72 6f 79 73 20 74 | 68 65 20 62 75 74 74 6f |stroys t|he butto|
|00004050| 6e 2e 0d 09 20 2a 2f 0d | 09 73 69 6d 70 6c 65 5f |n... */.|.simple_|
|00004060| 65 76 65 6e 74 5f 6c 6f | 6f 70 28 54 65 6d 70 4d |event_lo|op(TempM|
|00004070| 65 73 73 61 67 65 29 2e | 0d 09 0d 73 69 6d 70 6c |essage).|...simpl|
|00004080| 65 5f 65 76 65 6e 74 5f | 6c 6f 6f 70 28 54 65 6d |e_event_|loop(Tem|
|00004090| 70 4d 65 73 73 61 67 65 | 29 20 3a 2d 0d 09 69 6e |pMessage|) :-..in|
|000040a0| 69 74 43 75 72 73 6f 72 | 2c 0d 09 72 65 70 65 61 |itCursor|,..repea|
|000040b0| 74 2c 0d 09 73 79 73 74 | 65 6d 54 61 73 6b 2c 0d |t,..syst|emTask,.|
|000040c0| 09 28 67 65 74 4e 65 78 | 74 45 76 65 6e 74 28 2d |.(getNex|tEvent(-|
|000040d0| 31 2c 45 2c 74 72 75 65 | 29 20 2d 3e 20 70 72 6f |1,E,true|) -> pro|
|000040e0| 63 65 73 73 5f 65 76 65 | 6e 74 28 45 29 2c 0d 09 |cess_eve|nt(E),..|
|000040f0| 09 64 65 73 74 72 6f 79 | 65 64 28 54 65 6d 70 4d |.destroy|ed(TempM|
|00004100| 65 73 73 61 67 65 29 2c | 20 21 0d 09 29 2c 0d 09 |essage),| !..),..|
|00004110| 21 2c 0d 09 66 61 69 6c | 2e 0d 0d 2f 2a 0d 20 2a |!,..fail|.../*. *|
|00004120| 20 53 6f 6d 65 20 6e 6f | 74 69 63 65 20 66 75 6e | Some no|tice fun|
|00004130| 63 74 69 6f 6e 73 20 66 | 6f 72 20 64 69 73 70 6c |ctions f|or displ|
|00004140| 61 79 69 6e 67 20 73 74 | 61 74 75 73 20 69 6e 66 |aying st|atus inf|
|00004150| 6f 72 6d 61 74 69 6f 6e | 0d 20 2a 20 61 6e 64 20 |ormation|. * and |
|00004160| 70 72 6f 67 72 65 73 73 | 20 69 6e 66 6f 72 6d 61 |progress| informa|
|00004170| 74 69 6f 6e 2e 0d 20 2a | 2f 0d 67 65 74 5f 6e 6f |tion.. *|/.get_no|
|00004180| 74 69 63 65 5f 73 74 72 | 65 61 6d 28 4e 61 6d 65 |tice_str|eam(Name|
|00004190| 2c 20 53 74 72 65 61 6d | 29 20 3a 2d 0d 09 67 65 |, Stream|) :-..ge|
|000041a0| 74 5f 67 6c 6f 62 61 6c | 28 4e 61 6d 65 2c 20 53 |t_global|(Name, S|
|000041b0| 74 72 65 61 6d 29 2c 0d | 09 6e 6f 74 28 64 65 73 |tream),.|.not(des|
|000041c0| 74 72 6f 79 65 64 28 53 | 74 72 65 61 6d 29 29 2c |troyed(S|tream)),|
|000041d0| 0d 09 4f 62 6a 65 63 74 | 20 69 73 20 53 74 72 65 |..Object| is Stre|
|000041e0| 61 6d 5e 2e 73 74 72 65 | 61 6d 5f 6f 62 6a 65 63 |am^.stre|am_objec|
|000041f0| 74 2c 0d 09 6e 6f 74 28 | 64 65 73 74 72 6f 79 65 |t,..not(|destroye|
|00004200| 64 28 4f 62 6a 65 63 74 | 29 29 2c 0d 09 21 2e 0d |d(Object|)),..!..|
|00004210| 67 65 74 5f 6e 6f 74 69 | 63 65 5f 73 74 72 65 61 |get_noti|ce_strea|
|00004220| 6d 28 4e 61 6d 65 2c 20 | 53 74 72 65 61 6d 29 20 |m(Name, |Stream) |
|00004230| 3a 2d 0d 09 75 6e 73 65 | 74 5f 67 6c 6f 62 61 6c |:-..unse|t_global|
|00004240| 28 4e 61 6d 65 29 2c 0d | 09 73 74 61 6e 64 61 72 |(Name),.|.standar|
|00004250| 64 5f 6f 75 74 70 75 74 | 28 53 74 72 65 61 6d 29 |d_output|(Stream)|
|00004260| 2e 0d 0d 73 6e 6f 74 69 | 63 65 5f 6e 6f 6e 6c 28 |...snoti|ce_nonl(|
|00004270| 4e 53 2c 20 4e 6f 74 65 | 29 20 3a 2d 0d 09 67 65 |NS, Note|) :-..ge|
|00004280| 74 5f 6e 6f 74 69 63 65 | 5f 73 74 72 65 61 6d 28 |t_notice|_stream(|
|00004290| 4e 53 2c 20 4e 6f 74 69 | 63 65 53 74 72 65 61 6d |NS, Noti|ceStream|
|000042a0| 29 2c 0d 09 28 73 74 72 | 69 6e 67 28 4e 6f 74 65 |),..(str|ing(Note|
|000042b0| 29 20 2d 3e 20 70 72 69 | 6e 74 73 74 72 69 6e 67 |) -> pri|ntstring|
|000042c0| 28 4e 6f 74 69 63 65 53 | 74 72 65 61 6d 2c 20 4e |(NoticeS|tream, N|
|000042d0| 6f 74 65 29 0d 09 3b 09 | 77 72 69 74 65 28 4e 6f |ote)..;.|write(No|
|000042e0| 74 69 63 65 53 74 72 65 | 61 6d 2c 20 4e 6f 74 65 |ticeStre|am, Note|
|000042f0| 29 0d 09 29 2e 0d 73 6e | 6f 74 69 63 65 28 4e 53 |)..)..sn|otice(NS|
|00004300| 2c 20 4e 6f 74 65 29 20 | 3a 2d 0d 09 73 6e 6f 74 |, Note) |:-..snot|
|00004310| 69 63 65 5f 6e 6f 6e 6c | 28 4e 53 2c 20 4e 6f 74 |ice_nonl|(NS, Not|
|00004320| 65 29 2c 0d 09 67 65 74 | 5f 6e 6f 74 69 63 65 5f |e),..get|_notice_|
|00004330| 73 74 72 65 61 6d 28 4e | 53 2c 20 4e 6f 74 69 63 |stream(N|S, Notic|
|00004340| 65 53 74 72 65 61 6d 29 | 2c 0d 09 6e 6c 28 4e 6f |eStream)|,..nl(No|
|00004350| 74 69 63 65 53 74 72 65 | 61 6d 29 2e 0d 09 0d 73 |ticeStre|am)....s|
|00004360| 70 70 6e 6f 74 69 63 65 | 28 4e 53 2c 20 49 74 65 |ppnotice|(NS, Ite|
|00004370| 6d 29 20 3a 2d 0d 09 67 | 65 74 5f 6e 6f 74 69 63 |m) :-..g|et_notic|
|00004380| 65 5f 73 74 72 65 61 6d | 28 4e 53 2c 20 4e 6f 74 |e_stream|(NS, Not|
|00004390| 69 63 65 53 74 72 65 61 | 6d 29 2c 0d 09 69 6e 64 |iceStrea|m),..ind|
|000043a0| 65 6e 74 74 6f 28 4e 6f | 74 69 63 65 53 74 72 65 |entto(No|ticeStre|
|000043b0| 61 6d 2c 20 35 29 2c 0d | 09 70 70 70 72 69 6e 74 |am, 5),.|.ppprint|
|000043c0| 28 4e 6f 74 69 63 65 53 | 74 72 65 61 6d 2c 20 49 |(NoticeS|tream, I|
|000043d0| 74 65 6d 29 2c 0d 09 6e | 6c 28 4e 6f 74 69 63 65 |tem),..n|l(Notice|
|000043e0| 53 74 72 65 61 6d 29 2e | 0d 09 0d 73 6e 6f 74 69 |Stream).|...snoti|
|000043f0| 63 65 5f 74 69 6d 65 73 | 74 61 6d 70 28 4e 53 29 |ce_times|tamp(NS)|
|00004400| 20 3a 2d 0d 09 63 75 72 | 72 65 6e 74 5f 74 69 6d | :-..cur|rent_tim|
|00004410| 65 28 54 68 69 73 54 69 | 6d 65 29 2c 0d 09 73 6e |e(ThisTi|me),..sn|
|00004420| 6f 74 69 63 65 5f 6e 6f | 6e 6c 28 4e 53 2c 20 22 |otice_no|nl(NS, "|
|00004430| 40 22 29 2c 20 73 6e 6f | 74 69 63 65 5f 6e 6f 6e |@"), sno|tice_non|
|00004440| 6c 28 4e 53 2c 20 54 68 | 69 73 54 69 6d 65 29 2c |l(NS, Th|isTime),|
|00004450| 0d 09 73 6e 6f 74 69 63 | 65 28 4e 53 2c 20 22 3a |..snotic|e(NS, ":|
|00004460| 20 22 29 2e 0d 0d 2f 2a | 0d 20 2a 20 53 65 6e 64 | ").../*|. * Send|
|00004470| 69 6e 67 20 61 6e 64 20 | 52 65 70 6c 79 20 70 72 |ing and |Reply pr|
|00004480| 6f 63 65 73 73 69 6e 67 | 20 6d 65 73 73 61 67 65 |ocessing| message|
|00004490| 73 2e 0d 20 2a 2f 0d 6e | 6f 74 69 63 65 5f 6e 6f |s.. */.n|otice_no|
|000044a0| 6e 6c 28 4e 6f 74 65 29 | 20 3a 2d 0d 09 73 6e 6f |nl(Note)| :-..sno|
|000044b0| 74 69 63 65 5f 6e 6f 6e | 6c 28 6e 6f 74 69 63 65 |tice_non|l(notice|
|000044c0| 5f 73 74 72 65 61 6d 2c | 20 4e 6f 74 65 29 2e 0d |_stream,| Note)..|
|000044d0| 0d 6e 6f 74 69 63 65 28 | 4e 6f 74 65 29 20 3a 2d |.notice(|Note) :-|
|000044e0| 0d 09 73 6e 6f 74 69 63 | 65 28 6e 6f 74 69 63 65 |..snotic|e(notice|
|000044f0| 5f 73 74 72 65 61 6d 2c | 20 4e 6f 74 65 29 2e 0d |_stream,| Note)..|
|00004500| 09 0d 70 70 6e 6f 74 69 | 63 65 28 49 74 65 6d 29 |..ppnoti|ce(Item)|
|00004510| 20 3a 2d 0d 09 73 70 70 | 6e 6f 74 69 63 65 28 6e | :-..spp|notice(n|
|00004520| 6f 74 69 63 65 5f 73 74 | 72 65 61 6d 2c 20 49 74 |otice_st|ream, It|
|00004530| 65 6d 29 2e 0d 09 0d 6e | 6f 74 69 63 65 5f 74 69 |em)....n|otice_ti|
|00004540| 6d 65 73 74 61 6d 70 20 | 3a 2d 0d 09 73 6e 6f 74 |mestamp |:-..snot|
|00004550| 69 63 65 5f 74 69 6d 65 | 73 74 61 6d 70 28 6e 6f |ice_time|stamp(no|
|00004560| 74 69 63 65 5f 73 74 72 | 65 61 6d 29 2e 0d 0d 2f |tice_str|eam).../|
|00004570| 2a 0d 20 2a 20 52 65 63 | 65 69 76 69 6e 67 20 6e |*. * Rec|eiving n|
|00004580| 6f 74 69 63 65 73 0d 20 | 2a 2f 09 0d 72 6e 6f 74 |otices. |*/..rnot|
|00004590| 69 63 65 5f 6e 6f 6e 6c | 28 4e 6f 74 65 29 20 3a |ice_nonl|(Note) :|
|000045a0| 2d 0d 09 73 6e 6f 74 69 | 63 65 5f 6e 6f 6e 6c 28 |-..snoti|ce_nonl(|
|000045b0| 72 65 6d 6f 74 65 5f 6e | 6f 74 69 63 65 5f 73 74 |remote_n|otice_st|
|000045c0| 72 65 61 6d 2c 22 2a 2a | 20 22 29 2c 0d 09 73 6e |ream,"**| "),..sn|
|000045d0| 6f 74 69 63 65 5f 6e 6f | 6e 6c 28 72 65 6d 6f 74 |otice_no|nl(remot|
|000045e0| 65 5f 6e 6f 74 69 63 65 | 5f 73 74 72 65 61 6d 2c |e_notice|_stream,|
|000045f0| 20 4e 6f 74 65 29 2e 0d | 0d 72 6e 6f 74 69 63 65 | Note)..|.rnotice|
|00004600| 28 4e 6f 74 65 29 20 3a | 2d 0d 09 73 6e 6f 74 69 |(Note) :|-..snoti|
|00004610| 63 65 5f 6e 6f 6e 6c 28 | 72 65 6d 6f 74 65 5f 6e |ce_nonl(|remote_n|
|00004620| 6f 74 69 63 65 5f 73 74 | 72 65 61 6d 2c 22 2a 2a |otice_st|ream,"**|
|00004630| 20 22 29 2c 0d 09 73 6e | 6f 74 69 63 65 28 72 65 | "),..sn|otice(re|
|00004640| 6d 6f 74 65 5f 6e 6f 74 | 69 63 65 5f 73 74 72 65 |mote_not|ice_stre|
|00004650| 61 6d 2c 20 4e 6f 74 65 | 29 2e 0d 09 0d 72 70 70 |am, Note|)....rpp|
|00004660| 6e 6f 74 69 63 65 28 49 | 74 65 6d 29 20 3a 2d 0d |notice(I|tem) :-.|
|00004670| 09 73 6e 6f 74 69 63 65 | 5f 6e 6f 6e 6c 28 72 65 |.snotice|_nonl(re|
|00004680| 6d 6f 74 65 5f 6e 6f 74 | 69 63 65 5f 73 74 72 65 |mote_not|ice_stre|
|00004690| 61 6d 2c 22 2a 2a 20 22 | 29 2c 0d 09 73 70 70 6e |am,"** "|),..sppn|
|000046a0| 6f 74 69 63 65 28 72 65 | 6d 6f 74 65 5f 6e 6f 74 |otice(re|mote_not|
|000046b0| 69 63 65 5f 73 74 72 65 | 61 6d 2c 20 49 74 65 6d |ice_stre|am, Item|
|000046c0| 29 2e 0d 09 0d 72 6e 6f | 74 69 63 65 5f 74 69 6d |)....rno|tice_tim|
|000046d0| 65 73 74 61 6d 70 20 3a | 2d 0d 09 73 6e 6f 74 69 |estamp :|-..snoti|
|000046e0| 63 65 5f 6e 6f 6e 6c 28 | 72 65 6d 6f 74 65 5f 6e |ce_nonl(|remote_n|
|000046f0| 6f 74 69 63 65 5f 73 74 | 72 65 61 6d 2c 22 2a 2a |otice_st|ream,"**|
|00004700| 20 22 29 2c 0d 09 73 6e | 6f 74 69 63 65 5f 74 69 | "),..sn|otice_ti|
|00004710| 6d 65 73 74 61 6d 70 28 | 72 65 6d 6f 74 65 5f 6e |mestamp(|remote_n|
|00004720| 6f 74 69 63 65 5f 73 74 | 72 65 61 6d 29 2e 0d 2f |otice_st|ream)../|
|00004730| 2a 0d 20 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |*. *****|********|
|00004740| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004760| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0d 20 2a 2f |********|****. */|
|00004780| 0d 2f 2a 0d 20 2a 20 46 | 69 6e 61 6c 6c 79 20 63 |./*. * F|inally c|
|00004790| 6f 64 65 20 74 6f 20 73 | 74 61 72 74 20 74 68 65 |ode to s|tart the|
|000047a0| 20 64 65 6d 6f 2c 20 69 | 66 20 74 68 69 73 20 69 | demo, i|f this i|
|000047b0| 73 20 63 6c 69 63 6b 65 | 64 20 6f 6e 20 69 6e 20 |s clicke|d on in |
|000047c0| 74 68 65 20 46 69 6e 64 | 65 72 2e 0d 20 2a 2f 0d |the Find|er.. */.|
|000047d0| 3a 2d 20 70 72 6f 6c 6f | 67 5f 61 65 5f 64 65 6d |:- prolo|g_ae_dem|
|000047e0| 6f 2c 0d 09 2f 2a 0d 09 | 20 2a 20 57 65 20 63 61 |o,../*..| * We ca|
|000047f0| 6c 6c 20 61 62 6f 72 74 | 2c 20 73 6f 20 74 68 61 |ll abort|, so tha|
|00004800| 74 20 74 68 65 20 77 69 | 6e 64 6f 77 20 63 72 65 |t the wi|ndow cre|
|00004810| 61 74 65 64 20 77 69 6c | 6c 20 72 65 6d 61 69 6e |ated wil|l remain|
|00004820| 20 69 6e 20 0d 09 20 2a | 20 66 72 6f 6e 74 20 65 | in .. *| front e|
|00004830| 76 65 6e 20 69 66 20 74 | 68 69 73 20 66 69 6c 65 |ven if t|his file|
|00004840| 20 77 61 73 20 63 6f 6e | 73 75 6c 74 65 64 20 69 | was con|sulted i|
|00004850| 6e 20 74 68 65 20 51 75 | 65 72 79 20 57 69 6e 64 |n the Qu|ery Wind|
|00004860| 6f 77 2e 0d 09 20 2a 20 | 43 6f 6e 74 72 6f 6c 20 |ow... * |Control |
|00004870| 77 6f 6e 27 74 20 67 6f | 20 62 61 63 6b 20 74 6f |won't go| back to|
|00004880| 20 74 68 65 20 71 75 65 | 72 79 20 77 69 6e 64 6f | the que|ry windo|
|00004890| 77 2e 0d 09 20 2a 2f 0d | 20 20 20 61 62 6f 72 74 |w... */.| abort|
|000048a0| 2e 0d 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 00 01 00 00 00 01 a6 | 00 00 00 a6 00 00 00 6e |........|.......n|
|00004910| 52 65 73 6f 6c 76 65 2e | 70 3a 20 54 61 6c 6b 69 |Resolve.|p: Talki|
|00004920| 6e 67 20 77 69 74 68 20 | 43 6c 61 72 69 73 20 52 |ng with |Claris R|
|00004930| 12 54 61 6c 6b 20 77 69 | 74 68 20 50 72 6f 6c 6f |.Talk wi|th Prolo|
|00004940| 67 2e 70 20 02 00 00 00 | 54 45 58 54 41 49 46 43 |g.p ....|TEXTAIFC|
|00004950| 00 00 54 45 58 54 41 49 | 46 43 01 00 00 3c 00 00 |..TEXTAI|FC...<..|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 a6 07 84 33 00 00 | 48 23 00 00 02 14 63 2e |.....3..|H#....c.|
|00004980| 0d 20 2a 20 41 6c 6c 20 | 72 69 67 68 74 73 20 72 |. * All |rights r|
|00004990| 65 73 65 72 76 65 64 2e | 0d 20 2a 20 54 68 69 73 |eserved.|. * This|
|000049a0| 20 66 69 6c 65 20 6d 61 | 79 20 6e 6f 74 20 62 65 | file ma|y not be|
|000049b0| 20 63 6f 70 69 65 64 20 | 6f 72 20 64 69 73 74 72 | copied |or distr|
|000049c0| 69 62 75 74 65 64 20 77 | 69 74 68 6f 75 74 20 74 |ibuted w|ithout t|
|000049d0| 68 65 20 0d 20 2a 20 77 | 72 69 74 74 65 6e 20 70 |he . * w|ritten p|
|000049e0| 65 72 6d 69 73 73 69 6f | 6e 20 6f 66 20 41 64 76 |ermissio|n of Adv|
|000049f0| 61 6e 63 65 64 20 41 2e | 20 49 2e 20 53 79 73 74 |anced A.| I. Syst|
|00004a00| 00 00 00 80 88 88 88 88 | 22 22 22 22 88 bf fc 88 |........|""""....|
|00004a10| 22 e0 07 22 8b 00 00 c8 | 2c 07 e0 32 98 0c 70 18 |".."....|,..2..p.|
|00004a20| 20 10 18 06 e0 20 1c 04 | 40 20 1c 02 c0 00 1c 03 | .... ..|@ ......|
|00004a30| c0 00 1c 03 c0 00 1c 03 | c0 00 18 03 c0 00 70 03 |........|......p.|
|00004a40| c0 00 e0 02 c0 01 c0 02 | 60 01 c0 06 a0 00 00 04 |........|`.......|
|00004a50| 38 01 c0 1a 8c 01 c0 38 | 23 01 c0 e2 88 e0 07 88 |8......8|#.......|
|00004a60| 22 3f fe 22 88 88 88 88 | 22 22 22 22 88 88 88 88 |"?."....|""""....|
|00004a70| 22 22 22 22 88 88 88 88 | 22 22 22 22 88 88 88 88 |""""....|""""....|
|00004a80| 22 22 22 22 00 00 00 0a | 00 09 06 4d 6f 6e 61 63 |""""....|...Monac|
|00004a90| 6f 00 00 00 00 08 00 5a | 00 0e 01 54 01 ec 00 00 |o......Z|...T....|
|00004aa0| 00 04 00 30 00 08 00 00 | 01 00 00 00 01 a6 00 00 |...0....|........|
|00004ab0| 00 a6 00 00 00 6e 00 45 | 02 d0 05 e2 00 00 00 1c |.....n.E|........|
|00004ac0| 00 6e 00 03 49 43 4f 4e | 00 00 00 22 45 46 4e 54 |.n..ICON|..."EFNT|
|00004ad0| 00 00 00 2e 45 57 4e 44 | 00 00 00 3a 45 54 41 42 |....EWND|...:ETAB|
|00004ae0| 00 00 00 46 00 80 ff ff | 00 00 00 00 00 00 00 00 |...F....|........|
|00004af0| 03 eb ff ff 00 00 00 84 | 00 45 56 fc 01 00 ff ff |........|.EV.....|
|00004b00| 00 00 00 92 00 45 56 f8 | 03 ec ff ff 00 00 00 9e |.....EV.|........|
|00004b10| 00 45 56 f4 00 00 00 00 | 00 00 00 00 00 00 00 00 |.EV.....|........|
|00004b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+